Re: [PATCH v1] hugetlb: pass head page to remove_hugetlb_page()
From: Matthew Wilcox
Date: Wed May 26 2021 - 20:32:55 EST
On Thu, May 27, 2021 at 08:52:57AM +0900, Naoya Horiguchi wrote:
> From: Naoya Horiguchi <naoya.horiguchi@xxxxxxx>
>
> 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.
I'd like to point out that with folios, this is a compile-time error,
not a run-time error.