Re: [PATCH v2 4/4] mm: remove boolean output parameters from folio_pte_batch_ext()
From: Oscar Salvador
Date: Wed Jul 02 2025 - 13:53:47 EST
On Wed, Jul 02, 2025 at 04:40:30PM +0200, David Hildenbrand wrote:
> But more importantly, usually young+dirty is a moving target as HW can
> usually update it asynchronously.
Ok, you mean they often get queried both at once?
> So in the common case, you really have to rely on the young+dirty bits from
> get_and_clear_full_ptes(), and not on the current snapshot while the page
> remains mapped.
>
> The madvise() use case is rather special in that sense.
I see.
I mean, codewise this looks like an improvement, I was just puzzled by the
fact that we're dealing with young+dirty together (while we didn't before),
but given that get_and_clear_full_ptes() do that already, I guess it makes
sense if that's the way we usually operate.
I wasn't familiar with that, thinking about it makes sense, but I wonder whether
we could place a comment either in the definition of FPB_MERGE_YOUNG_DIRTY, or in
the handling of it in folio_pte_batch_flags().
I guess in the definition would make more sense.
Whether you decide to move forward on the comment or not (could be
squashed), I'm ok with this.
--
Oscar Salvador
SUSE Labs