Re: [RFC PATCH 05/12] fs/proc/task_mmu: refactor pagemap_pmd_range()

Lorenzo Stoakes
2025-10-27T16:28:05Z

On Mon, Oct 27, 2025 at 01:11:46PM -0300, Jason Gunthorpe wrote:
> On Fri, Oct 24, 2025 at 04:37:18PM -0400, Gregory Price wrote:
> > On Fri, Oct 24, 2025 at 09:15:59PM +0100, Lorenzo Stoakes wrote:
> > > On Fri, Oct 24, 2025 at 03:12:08PM -0400, Gregory Price wrote:
> > >
> > > So maybe actually that isn't too bad of an idea...
> > >
> > > Could also be
> > >
> > > nonpresent_or_swap_t but that's kinda icky...
> >
> > clearly we need:
> >
> > union {
> > swp_entry_t swap;
> > nonpresent_entry_t np;
> > pony_entry_t pony;
> > plum_emtry_t beer;
> > } leaf_entry_t;

I think Greg meant this as a joke [correct me if wrong] :) that was my
impression anyway (see original end of email...)

> >
> > with
> >
> > leaf_type whats_that_pte(leaf_entry_t);
>
> I think if you are going to try to rename swp_entry_t that is a pretty

Will reply elsewhere, but yes that's the intent.

> good idea. Maybe swleaf_entry_t to pace emphasis that it is not used

I get the point but that's kinda a horrible name visually.

sw_leaf_entry_t too... yeah maybe we can just put the software bit in a comment
maybe :)

> by the HW page table walker would be a good compromise to the ugly
> 'non-present entry' term.

I like leaf_entry_t name-wise.

I don't love the union.

How would we determine what type it is, we'd have to have some
generic_leaf_entry_t type or something to contain the swap type field and then
cast and... is it worth it?

Intent of non-present was to refer to not-swap swapentry. It's already a
convention that exists, e.g. is_pmd_non_present_folio_entry().

>
> Jason
>

Cheers, Lorenzo