Re: [PATCH 02/16] mm: introduce leaf entry type and use to simplify leaf entry logic
From: Lorenzo Stoakes
Date: Wed Nov 05 2025 - 15:06:05 EST
On Wed, Nov 05, 2025 at 03:01:00PM -0500, Gregory Price wrote:
> On Wed, Nov 05, 2025 at 07:52:36PM +0000, Lorenzo Stoakes wrote:
> > On Wed, Nov 05, 2025 at 02:25:34PM -0500, Gregory Price wrote:
> > > On Wed, Nov 05, 2025 at 07:06:11PM +0000, Matthew Wilcox wrote:
> > I thought about doing this but it doesn't really work as the type is
> > _abstracted_ from the architecture-specific value, _and_ we use what is
> > currently the swp_type field to identify what this is.
> >
> > So we would lose the architecture-specific information that any 'hardware leaf'
> > entry would require and not be able to reliably identify it without losing bits.
> >
> > Trying to preserve the value _and_ correctly identify it as a present entry
> > would be difficult.
> >
> > And I _really_ didn't want to go on a deep dive through all the architectures to
> > see if we could encode it differently to allow for this.
> >
> > Rather I think it's better to differentiate between s/w + h/w leaf entries.
> >
>
> Reasonable - names are hard, but just about anything will be better than swp_entry.
>
> SWE / sw_entry seems perfectly reasonable.
I'm not a lover of 'sw' in there it's just... eye-stabby. Is that a word?
I am quite fond of my suggested soft_leaf_t, softleaf_xxx()
'Soft leaf' breezing in the wind... quite poignant no? :)
But also embodies both the leaf entry and the fact it's software, coins a
new term which is easy to figure out and of course the comment will
describe what it means, and doesn't cause eye fatigue? :)
Yes naming is subjective and hard, as always :P
>
> ~Gregory
>
Cheers, Lorenzo