[PATCH 31/46] mm/mremap: fix moving PUD leaves
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Mon Oct 26 17:13:40 PDT 2026
> From: Josef Bacik <josef at toxicpanda.com>
>
> pud_none_or_clear_bad() only really works on page tables. PUD leaves
> confuse the check and make us clear the page table entry and print a
> warning.
>
> Since commit aed877c2b4257 ("device/dax: properly refcount device dax pages
> when mapping"), this also leaks device-DAX folio references, mapcounts
> and RSS accounting, resulting in "Bad rss-counter state" warnings on exit.
>
> Allow PUD leaves in get_old_pud(). If a PUD leaf cannot be moved as a
> whole or the move fails, split it. This unmaps it with proper accounting
> instead of treating the leaf entry as a PMD table.
>
> Keep using pud_trans_huge() for now, in the future this code should be
> cleaned up to just check for PUD leaves.
>
> Fix generated by an LLM and sent by Josef Bacik in private.
>
> Fixes: a00cc7d9dd93 ("mm, x86: add support for PUD-sized transparent hugepages")
> Cc: stable at vger.kernel.org
> Signed-off-by: Josef Bacik <josef at toxicpanda.com>
> Reviewed-by: Lorenzo Stoakes (ARM) <ljs at kernel.org>
> [ david: fallthrough after splitting ]
> Signed-off-by: David Hildenbrand (Arm) <david at kernel.org>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261027-fixes_core-v1-0-6f74bec9a5bb@kernel.org?part=31
More information about the kexec
mailing list