[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <03e363c3-638a-4017-99c2-b6668ca8d25a@lucifer.local>
Date: Wed, 5 Nov 2025 17:32:29 +0000
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: Jason Gunthorpe <jgg@...pe.ca>
Cc: Gregory Price <gourry@...rry.net>,
Andrew Morton <akpm@...ux-foundation.org>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Janosch Frank <frankja@...ux.ibm.com>,
Claudio Imbrenda <imbrenda@...ux.ibm.com>,
David Hildenbrand <david@...hat.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>, Matthew Wilcox <willy@...radead.org>,
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 01:21:15PM -0400, Jason Gunthorpe wrote:
> On Wed, Nov 05, 2025 at 09:42:24AM -0500, Gregory Price wrote:
> > On Mon, Nov 03, 2025 at 12:31:43PM +0000, Lorenzo Stoakes wrote:
> > > +typedef swp_entry_t leaf_entry_t;
> > > +
> > > +#ifdef CONFIG_MMU
> > > +
> > > +/* Temporary until swp_entry_t eliminated. */
> > > +#define LEAF_TYPE_SHIFT SWP_TYPE_SHIFT
> > > +
> > > +enum leaf_entry_type {
> > > + /* Fundamental types. */
> > > + LEAFENT_NONE,
> > > + LEAFENT_SWAP,
> > > + /* Migration types. */
> > > + LEAFENT_MIGRATION_READ,
> > > + LEAFENT_MIGRATION_READ_EXCLUSIVE,
> > > + LEAFENT_MIGRATION_WRITE,
> > > + /* Device types. */
> > > + LEAFENT_DEVICE_PRIVATE_READ,
> > > + LEAFENT_DEVICE_PRIVATE_WRITE,
> > > + LEAFENT_DEVICE_EXCLUSIVE,
> > > + /* H/W posion types. */
> > > + LEAFENT_HWPOISON,
> > > + /* Marker types. */
> > > + LEAFENT_MARKER,
> > > +};
> > > +
> >
> > Have been browsing the patch set again, will get around a deeper review,
> > but just wanted to say this is a thing of beauty :]
>
> +1 I thought the same thing. So much clearer what is going on here,
> and I didn't realize we had so many types already..
>
> Jason
Thank you both guys much appreciated :)
Obviously heavily influenced by your great feedback, but I really did try to
build it in a way that tried to simplify as much as possible.
Cheers, Lorenzo
Powered by blists - more mailing lists