[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z_c_onLZDJzqEeiu@casper.infradead.org>
Date: Thu, 10 Apr 2025 04:48:50 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Fan Ni <nifan.cxl@...il.com>
Cc: muchun.song@...ux.dev, mcgrof@...nel.org, a.manzanares@...sung.com,
dave@...olabs.net, akpm@...ux-foundation.org, david@...hat.com,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/hugetlb: Convert &folio->page to folio_page(folio, 0)
On Wed, Apr 09, 2025 at 03:07:50PM -0700, Fan Ni wrote:
> On Wed, Apr 09, 2025 at 04:15:30AM +0100, Matthew Wilcox wrote:
> > > */
> > > - free_page_and_swap_cache(&new_folio->page);
> > > + free_page_and_swap_cache(folio_page(new_folio, 0));
> > > }
> >
> > free_page_and_swap_cache() should be converted to be
> > free_folio_and_swap_cache().
>
> While looking into this function, I see it is defined as a macro in
> swap.h as below,
> #define free_page_and_swap_cache(page) \
> put_page(page)
>
> While checking put_page() in include/linux.mm.h, it always converts page
> to folio, is there a reason why we do not take "folio" directly?
There are a lot of places to convert!
$ git grep '[^a-zA-Z_>]put_page(' |wc -l
472
... and that's after four years of doing folio conversions.
free_folio_and_swap_cache() should call folio_put() in the !CONFIG_SWAP
case.
Powered by blists - more mailing lists