diff options
author | Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> | 2012-12-12 16:52:33 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-12-12 20:38:35 -0500 |
commit | 56f2fb147659e05b1e87b99791bf44b988d38545 (patch) | |
tree | 7e29f1c2cf74e4789ec5429bab3dc4f45a12ef89 /mm | |
parent | 5f24ae585be985691c017b7ab90b3669dca32d6d (diff) |
mm/hugetlb.c: fix warning on freeing hwpoisoned hugepage
Fix the warning from __list_del_entry() which is triggered when a process
tries to do free_huge_page() for a hwpoisoned hugepage.
free_huge_page() can be called for hwpoisoned hugepage from
unpoison_memory(). This function gets refcount once and clears
PageHWPoison, and then puts refcount twice to return the hugepage back to
free pool. The second put_page() finally reaches free_huge_page().
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Cc: Andi Kleen <andi.kleen@intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/hugetlb.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index e53f39cd67db..22508ef943e6 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -3172,7 +3172,13 @@ int dequeue_hwpoisoned_huge_page(struct page *hpage) | |||
3172 | 3172 | ||
3173 | spin_lock(&hugetlb_lock); | 3173 | spin_lock(&hugetlb_lock); |
3174 | if (is_hugepage_on_freelist(hpage)) { | 3174 | if (is_hugepage_on_freelist(hpage)) { |
3175 | list_del(&hpage->lru); | 3175 | /* |
3176 | * Hwpoisoned hugepage isn't linked to activelist or freelist, | ||
3177 | * but dangling hpage->lru can trigger list-debug warnings | ||
3178 | * (this happens when we call unpoison_memory() on it), | ||
3179 | * so let it point to itself with list_del_init(). | ||
3180 | */ | ||
3181 | list_del_init(&hpage->lru); | ||
3176 | set_page_refcounted(hpage); | 3182 | set_page_refcounted(hpage); |
3177 | h->free_huge_pages--; | 3183 | h->free_huge_pages--; |
3178 | h->free_huge_pages_node[nid]--; | 3184 | h->free_huge_pages_node[nid]--; |