Re: [PATCH v1 1/4] mm: convert FPB_IGNORE_* into FPB_HONOR_*

From: David Hildenbrand
Date: Sat Jun 28 2025 - 17:00:56 EST


On 28.06.25 05:37, Dev Jain wrote:

On 27/06/25 5:25 pm, David Hildenbrand wrote:
Honoring these PTE bits is the exception, so let's invert the meaning.

With this change, most callers don't have to pass any flags.

No functional change intended.

FWIW I had proposed this kind of change earlier to Ryan (CCed) and
he pointed out: "Doesn't that argument apply in reverse if you want
to ignore something new in future?

By default we are comparing all the bits in the pte when determining the batch.
The flags request to ignore certain bits.

That statement is not true: as default we ignore the write and young bit. And we don't have flags for that ;)

Now we also ignore the dirty and soft-dity bit as default, unless told not to do that by one very specific caller.

If we want to ignore extra bits in
future, we add new flags and the existing callers don't need to be updated.

What stops you from using FPB_IGNORE_* for something else in the future?

As a side note, there are not that many relevant PTE bits to worry about in the near future ;)

I mean, uffd-wp, sure, ... and before we add a FPB_HONOR_UFFD_WP to all users to be safe (and changing the default to ignore), you could add a FPB_IGNORE_UFFD_WP first, to then check who really can tolerate just ignoring it (most of them, I assume).

--
Cheers,

David / dhildenb