]> git.itanic.dy.fi Git - linux-stable/commit
mm: prep_compound_tail() clear page->private
authorHugh Dickins <hughd@google.com>
Sat, 22 Oct 2022 07:51:06 +0000 (00:51 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 28 Oct 2022 20:37:22 +0000 (13:37 -0700)
commit5aae9265ee1a30cf716d6caf6b29fe99b9d55130
treef3e214d827733b0995e8eada8d3d342fd1f4f7f2
parent8ebe0a5eaaeb099de03d09ad20f54ed962e2261e
mm: prep_compound_tail() clear page->private

Although page allocation always clears page->private in the first page or
head page of an allocation, it has never made a point of clearing
page->private in the tails (though 0 is often what is already there).

But now commit 71e2d666ef85 ("mm/huge_memory: do not clobber swp_entry_t
during THP split") issues a warning when page_tail->private is found to be
non-0 (unless it's swapcache).

Change that warning to dump page_tail (which also dumps head), instead of
just the head: so far we have seen dead000000000122dead000000000003,
dead000000000001 or 0000000000000002 in the raw output for tail private.

We could just delete the warning, but today's consensus appears to want
page->private to be 0, unless there's a good reason for it to be set: so
now clear it in prep_compound_tail() (more general than just for THP; but
not for high order allocation, which makes no pass down the tails).

Link: https://lkml.kernel.org/r/1c4233bb-4e4d-5969-fbd4-96604268a285@google.com
Fixes: 71e2d666ef85 ("mm/huge_memory: do not clobber swp_entry_t during THP split")
Signed-off-by: Hugh Dickins <hughd@google.com>
Acked-by: Mel Gorman <mgorman@techsingularity.net>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/huge_memory.c
mm/page_alloc.c