Commit 56f2fb14 authored by Naoya Horiguchi's avatar Naoya Horiguchi Committed by Linus Torvalds

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: default avatarNaoya Horiguchi <>
Reviewed-by: default avatarAneesh Kumar K.V <>
Cc: Andi Kleen <>
Cc: Tony Luck <>
Cc: Wu Fengguang <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 5f24ae58
......@@ -3172,7 +3172,13 @@ int dequeue_hwpoisoned_huge_page(struct page *hpage)
if (is_hugepage_on_freelist(hpage)) {
* Hwpoisoned hugepage isn't linked to activelist or freelist,
* but dangling hpage->lru can trigger list-debug warnings
* (this happens when we call unpoison_memory() on it),
* so let it point to itself with list_del_init().
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment