Skip to content

Commit 0c5da35

Browse files
nhoriguchitorvalds
authored andcommitted
hugetlb: pass head page to remove_hugetlb_page()
When memory_failure() or soft_offline_page() is called on a tail page of some hugetlb page, "BUG: unable to handle page fault" error can be triggered. remove_hugetlb_page() dereferences page->lru, so it's assumed that the page points to a head page, but one of the caller, dissolve_free_huge_page(), provides remove_hugetlb_page() with 'page' which could be a tail page. So pass 'head' to it, instead. Link: https://lkml.kernel.org/r/[email protected] Fixes: 6eb4e88 ("hugetlb: create remove_hugetlb_page() to separate functionality") Signed-off-by: Naoya Horiguchi <[email protected]> Reviewed-by: Mike Kravetz <[email protected]> Reviewed-by: Muchun Song <[email protected]> Acked-by: Michal Hocko <[email protected]> Reviewed-by: Oscar Salvador <[email protected]> Cc: Miaohe Lin <[email protected]> Cc: Matthew Wilcox <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 9281305 commit 0c5da35

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/hugetlb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1793,7 +1793,7 @@ int dissolve_free_huge_page(struct page *page)
17931793
SetPageHWPoison(page);
17941794
ClearPageHWPoison(head);
17951795
}
1796-
remove_hugetlb_page(h, page, false);
1796+
remove_hugetlb_page(h, head, false);
17971797
h->max_huge_pages--;
17981798
spin_unlock_irq(&hugetlb_lock);
17991799
update_and_free_page(h, head);

0 commit comments

Comments
 (0)