Re: [PATCH] mm: clear pmd in pmdp_invalidate()

From: David Hildenbrand (Arm)

Date: Tue Oct 27 2026 - 08:20:08 EST


On 10/27/26 12:38, Guilherme Giacomo Simoes wrote:
> when attempt to do a madvise in a chunk of memory allocated by mmap, the
> folio_split is called to split a portion of memory, and despite the path
> leads to pmd_mkinvalid() they do not clear the pmd and clearer wording,
> leading to a BUG_ON inside page_table_check_set() because the map count
> is more than 1.
>
> Call the page_table_check_pmd_clear() inside pmdp_invalidate() generic
> function to ensure that the pmd will have they map count decrement.
>

The subject + description is rather confusing: you are not "clearing the pmd",
you tell page-table-check that the PMD was cleared.

This is all about apge-table-check.

Can you post the actual kernel splat you ran into? Or is this generated by an LLM?

Thanks!

--
Cheers,

David