Re: [PATCH] mm/huge_memory: transfer the pmd dirty bit to the folio on zap
From: Christoph Hellwig
Date: Wed Aug 26 2026 - 00:42:56 EST
On Tue, Aug 25, 2026 at 09:40:31AM +0100, Pedro Falcato wrote:
> That is true. However, I don't think that should stop us from providing
> reasonable semantics for those that use mmap.
>
> Fundamentally:
> - For the common, PTE-level case: we get the granularity for free, the
> filesystem only needs to be notified accordingly.
Where "for free" means that the mapping granularity has to be reduced.
> - For the less common, PMD-level case: we already aggressively break these
> down on mkwrite faults; I think doing this is the right tradeoff. Screw the TLB
> in that case :)
Puh.
> And, frankly, half of the problem (and related to the GUP thread) is that
> page_mkwrite is a crap interface... Something like ->write_begin() being
> generalised to more than read(2)/write(2) could possibly solve most of these
> issues (or a ranged dirty_folio).
I agree that everything around page fault notifications is a mess.
But ->write_begin is worse, it's not even a proper method but a layering
violation that needs to go away (or rather moved out of address_space
directly into the user of generic_perform_write).