[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMgjq7CPkHLauHfaDweoGUHxLxvkj4Vb1hEbw==oWa6aGgSTpg@mail.gmail.com>
Date: Thu, 2 May 2024 17:38:04 +0800
From: Kairui Song <ryncsn@...il.com>
To: David Hildenbrand <david@...hat.com>
Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
"Huang, Ying" <ying.huang@...el.com>, Matthew Wilcox <willy@...radead.org>, Chris Li <chrisl@...nel.org>,
Barry Song <v-songbaohua@...o.com>, Ryan Roberts <ryan.roberts@....com>, Neil Brown <neilb@...e.de>,
Minchan Kim <minchan@...nel.org>, Hugh Dickins <hughd@...gle.com>,
Yosry Ahmed <yosryahmed@...gle.com>, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 11/12] mm: drop page_index and convert folio_index to
use folio
On Thu, May 2, 2024 at 5:32 PM Kairui Song <ryncsn@...il.com> wrote:
>
> On Thu, May 2, 2024 at 5:12 PM David Hildenbrand <david@...hat.com> wrote:
> >
> > On 02.05.24 10:49, Kairui Song wrote:
> > > From: Kairui Song <kasong@...cent.com>
> > >
> > > There are two helpers for retrieving the index within address space
> > > for mixed usage of swap cache and page cache:
> > >
> > > - page_index
> > > - folio_index (wrapper of page_index)
> > >
> > > This commit drops page_index, as we have eliminated all users, and
> > > converts folio_index to use folio internally.
> >
> > The latter does not make sense. folio_index() already is using a folio
> > internally. Maybe a leftover from reshuffling/reworking patches?
>
> Hi, David,
>
> folio_index calls swapcache_index, and swapcache_index is defined as:
>
> #define swapcache_index(folio) __page_file_index(&(folio)->page)
>
> Where it casts the folio to page first, then call __page_file_index,
> __page_file_index is a function and works on pages.
>
> After this commit __page_file_index is converted to
> __folio_swap_cache_index. This change is a bit of trivial but we get
> rid of the internal page conversion.
>
> I can simplify the commit message, just say drop page_index to make
> the code cleaner, if this is confusing.
Ah, you are right folio_index is not a simple wrapper of page_index
indeed, that sentence in the commit message doesn't make sense, so it
should be deleted, my bad for this leftover.
Powered by blists - more mailing lists