Skip to content

Commit 274fe92

Browse files
osalvadorvilardagaakpm00
authored andcommitted
mm, hugetlb: increment the number of pages to be reset on HVO
commit 4eeec8c ("mm: move hugetlb specific things in folio to page[3]") shifted hugetlb specific stuff, and now mapping overlaps _hugetlb_cgroup field. Upon restoring the vmemmap for HVO, only the first two tail pages are reset, and this causes the check in free_tail_page_prepare() to fail as it finds an unexpected mapping value in some tails. Increment the number of pages to be reset to 4 (head + 3 tail pages) Link: https://lkml.kernel.org/r/20250415111859.376302-1-osalvador@suse.de Fixes: 4eeec8c ("mm: move hugetlb specific things in folio to page[3]") Signed-off-by: Oscar Salvador <osalvador@suse.de> Suggested-by: David Hildenbrand <david@redhat.com> Reviewed-by: David Hildenbrand <david@redhat.com> Reviewed-by: Muchun Song <muchun.song@linux.dev> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 9e88899 commit 274fe92

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mm/hugetlb_vmemmap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,11 @@ static void vmemmap_remap_pte(pte_t *pte, unsigned long addr,
238238
* struct page, the special metadata (e.g. page->flags or page->mapping)
239239
* cannot copy to the tail struct page structs. The invalid value will be
240240
* checked in the free_tail_page_prepare(). In order to avoid the message
241-
* of "corrupted mapping in tail page". We need to reset at least 3 (one
242-
* head struct page struct and two tail struct page structs) struct page
241+
* of "corrupted mapping in tail page". We need to reset at least 4 (one
242+
* head struct page struct and three tail struct page structs) struct page
243243
* structs.
244244
*/
245-
#define NR_RESET_STRUCT_PAGE 3
245+
#define NR_RESET_STRUCT_PAGE 4
246246

247247
static inline void reset_struct_pages(struct page *start)
248248
{

0 commit comments

Comments
 (0)