lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2d1f420e-c391-487d-a3cc-536eb62f3518@lucifer.local>
Date: Wed, 5 Nov 2025 21:08:14 +0000
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: "David Hildenbrand (Red Hat)" <davidhildenbrandkernel@...il.com>
Cc: Gregory Price <gourry@...rry.net>, Matthew Wilcox <willy@...radead.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Christian Borntraeger <borntraeger@...ux.ibm.com>,
        Janosch Frank <frankja@...ux.ibm.com>,
        Claudio Imbrenda <imbrenda@...ux.ibm.com>,
        Alexander Gordeev <agordeev@...ux.ibm.com>,
        Gerald Schaefer <gerald.schaefer@...ux.ibm.com>,
        Heiko Carstens <hca@...ux.ibm.com>, Vasily Gorbik <gor@...ux.ibm.com>,
        Sven Schnelle <svens@...ux.ibm.com>, Peter Xu <peterx@...hat.com>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
        Arnd Bergmann <arnd@...db.de>, Zi Yan <ziy@...dia.com>,
        Baolin Wang <baolin.wang@...ux.alibaba.com>,
        "Liam R . Howlett" <Liam.Howlett@...cle.com>,
        Nico Pache <npache@...hat.com>, Ryan Roberts <ryan.roberts@....com>,
        Dev Jain <dev.jain@....com>, Barry Song <baohua@...nel.org>,
        Lance Yang <lance.yang@...ux.dev>, Muchun Song <muchun.song@...ux.dev>,
        Oscar Salvador <osalvador@...e.de>, Vlastimil Babka <vbabka@...e.cz>,
        Mike Rapoport <rppt@...nel.org>,
        Suren Baghdasaryan <surenb@...gle.com>, Michal Hocko <mhocko@...e.com>,
        Matthew Brost <matthew.brost@...el.com>,
        Joshua Hahn <joshua.hahnjy@...il.com>, Rakie Kim <rakie.kim@...com>,
        Byungchul Park <byungchul@...com>,
        Ying Huang <ying.huang@...ux.alibaba.com>,
        Alistair Popple <apopple@...dia.com>,
        Axel Rasmussen <axelrasmussen@...gle.com>,
        Yuanchu Xie <yuanchu@...gle.com>, Wei Xu <weixugc@...gle.com>,
        Kemeng Shi <shikemeng@...weicloud.com>,
        Kairui Song <kasong@...cent.com>, Nhat Pham <nphamcs@...il.com>,
        Baoquan He <bhe@...hat.com>, Chris Li <chrisl@...nel.org>,
        SeongJae Park <sj@...nel.org>, Jason Gunthorpe <jgg@...pe.ca>,
        Leon Romanovsky <leon@...nel.org>, Xu Xin <xu.xin16@....com.cn>,
        Chengming Zhou <chengming.zhou@...ux.dev>,
        Jann Horn <jannh@...gle.com>, Miaohe Lin <linmiaohe@...wei.com>,
        Naoya Horiguchi <nao.horiguchi@...il.com>,
        Pedro Falcato <pfalcato@...e.de>,
        Pasha Tatashin <pasha.tatashin@...een.com>,
        Rik van Riel <riel@...riel.com>, Harry Yoo <harry.yoo@...cle.com>,
        Hugh Dickins <hughd@...gle.com>, linux-kernel@...r.kernel.org,
        kvm@...r.kernel.org, linux-s390@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
        linux-arch@...r.kernel.org, damon@...ts.linux.dev
Subject: Re: [PATCH 02/16] mm: introduce leaf entry type and use to simplify
 leaf entry logic

On Wed, Nov 05, 2025 at 09:11:45PM +0100, David Hildenbrand (Red Hat) wrote:
> On 05.11.25 21:05, Lorenzo Stoakes wrote:
> > 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()
>
> We do have soft_dirty.
>
> It will get interesting with pte_swp_soft_dirty() :)

Hmm but that's literally a swap entry, and is used against an actual PTE entry
not an abstracted s/w leaf entry so I doubt that'd require renaming on any
level.

>
> ptw_softlead_soft_dirty() Well, at least I would understand it.

Yeah the naming would never be pte_softleaf_soft_dirty() anyway.

If it was to exist in softleaf terms it'd be softleaf_is_soft_dirty() which
would be a lot clearer.

The PTE-specific functions implemented in leafops.h are prefixed pte_xxx()
simply :)

(Other than e.g. softleaf_from_pte() or softleaf_from_pmd()).

I think you could find issues with any name, I maintain softleaf is a good
compromise while remaining readable. :)

Cheers, Lorenzo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ