[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7caff42a-d471-4b4d-b7bf-61f74a75b9d0@lucifer.local>
Date: Fri, 24 Oct 2025 21:17:14 +0100
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: Gregory Price <gourry@...rry.net>
Cc: 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>, 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>,
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>,
Peter Xu <peterx@...hat.com>, Matthew Wilcox <willy@...radead.org>,
Jason Gunthorpe <jgg@...pe.ca>, Leon Romanovsky <leon@...nel.org>,
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>,
Jann Horn <jannh@...gle.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>, Pedro Falcato <pfalcato@...e.de>,
Pasha Tatashin <pasha.tatashin@...een.com>,
Rik van Riel <riel@...riel.com>, Harry Yoo <harry.yoo@...cle.com>,
kvm@...r.kernel.org, linux-s390@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-mm@...ck.org
Subject: Re: [RFC PATCH 11/12] mm: rename non_swap_entry() to
is_non_present_entry()
On Fri, Oct 24, 2025 at 03:07:40PM -0400, Gregory Price wrote:
> On Fri, Oct 24, 2025 at 08:41:27AM +0100, Lorenzo Stoakes wrote:
> > Referring to non-swap swap entries is simply confusing. While we store
> > non-present entries unrelated to swap itself, in swp_entry_t fields, we can
> > avoid referring to them as 'non-swap' entries.
> >
> --- >8
> > static void ptep_zap_swap_entry(struct mm_struct *mm, swp_entry_t entry)
> > {
> > - if (!non_swap_entry(entry))
> > + if (!is_non_present_entry(entry))
> > dec_mm_counter(mm, MM_SWAPENTS);
>
> I guess the question I have here is whether it's feasible to invert the
> logic to avoid the double-negative not-logic.
Ah well, see the next patch :)
>
> Anyway, naming is hard. In general I appreciate the additional clarity,
> even if we still have some `!is_non_*` logic sprinkled about.
Again this is a prelude to 12/12 :P
>
> --- addt'l aside semi-unrelated to your patches
>
> I can see where this is going in the long run, but the name of this
> function (ptep_zap_swap_entry) is as frustrating as the check for
> non_swap_entry(entry).
>
> may as well call it `ptep_zap_leaf_thingy` if it's handling multiple
> special entry types.
>
> but renaming even more functions in strange places outside scope here.
Yeah there's more to do for sure, I'll add this to the list... :)
>
> ---
>
> ~Gregory
Cheers, Lorenzo
Powered by blists - more mailing lists