[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMgjq7Bv5mgVwca0aN2RhJXkJuVPtKFCjv915WcgaDKD9_DM3w@mail.gmail.com>
Date: Thu, 1 May 2025 18:08:19 +0800
From: Kairui Song <ryncsn@...il.com>
To: David Hildenbrand <david@...hat.com>
Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>, 
	Matthew Wilcox <willy@...radead.org>, Hugh Dickins <hughd@...gle.com>, Chris Li <chrisl@...nel.org>, 
	Yosry Ahmed <yosryahmed@...gle.com>, "Huang, Ying" <ying.huang@...ux.alibaba.com>, 
	Nhat Pham <nphamcs@...il.com>, Johannes Weiner <hannes@...xchg.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 5/6] mm: move folio_index to mm/swap.h and remove no
 longer needed helper
On Thu, May 1, 2025 at 5:11 AM David Hildenbrand <david@...hat.com> wrote:
>
> On 30.04.25 20:10, Kairui Song wrote:
> > From: Kairui Song <kasong@...cent.com>
> >
> > There are no remaining users of folio_index() outside the mm subsystem.
> > Move it to mm/swap.h to co-locate it with swap_cache_index(), eliminating
> > a forward declaration, and a function call overhead.
> >
> > Also remove the helper that was used to fix circular header dependency
> > issue.
> >
> > Signed-off-by: Kairui Song <kasong@...cent.com>
> > ---
> >   include/linux/pagemap.h | 20 --------------------
> >   mm/gup.c                |  1 +
> >   mm/memfd.c              |  1 +
> >   mm/migrate.c            |  1 +
> >   mm/page-writeback.c     |  1 +
> >   mm/swap.h               | 18 ++++++++++++++++++
> >   mm/swapfile.c           |  6 ------
> >   7 files changed, 22 insertions(+), 26 deletions(-)
>
> [...]
>
> >   bool isolate_movable_page(struct page *page, isolate_mode_t mode)
> >   {
> > diff --git a/mm/page-writeback.c b/mm/page-writeback.c
> > index 20e1d76f1eba..9ff44b64d3d6 100644
> > --- a/mm/page-writeback.c
> > +++ b/mm/page-writeback.c
> > @@ -41,6 +41,7 @@
> >   #include <trace/events/writeback.h>
> >
> >   #include "internal.h"
> > +#include "swap.h"
>
> I wonder if we should just have it in mm/internal.h instead?
That will require internal.h to depend on swap.h. In follow up patches
I'd like to remove the folio_index usage in all places except migrate
and swap files, this will make the code cleaner and swap cache will be
less exposed.
>
> In any case
>
> Acked-by: David Hildenbrand <david@...hat.com>
Thanks!
>
> --
> Cheers,
>
> David / dhildenb
>
>
Powered by blists - more mailing lists