Re: [RFC PATCH] mm/rmap: use release ordering for small-folio mapcount removal
From: David Hildenbrand (Arm)
Date: Wed Nov 04 2026 - 04:19:29 EST
On 11/4/26 02:31, Pranith Kumar wrote:
> Removing a PTE mapping must precede lowering its folio's mapcount.
> The COW path relies on this order to keep the old page from being
> reused while a stale translation can still access it. The mapcount
> update needs release ordering for that edge, rather than the full
> ordering of atomic_add_negative().
>
> Use atomic_add_negative_release() for non-large folios removed at PTE
> level. Leave large-folio operations fully ordered; their path can
> queue a partially mapped folio for deferred splitting. Update the
> COW ordering comment to describe the required guarantee.
>
> In an arm64 page map/unmap microbenchmark with 20,480 minor
> faults, simulated cycles fell by 1.54%.
Thanks for the patch.
While I see value, I am not convinced this is the right time for this
micro-optimization while we are busy with other things.
This needs a better evaluation: 1.54% in a micro-benchmark without knowing the
stddev isn't particularly helpful.
--
Cheers,
David