linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Fan Ni <nifan.cxl@gmail.com>
Cc: muchun.song@linux.dev, mcgrof@kernel.org,
	a.manzanares@samsung.com, dave@stgolabs.net,
	akpm@linux-foundation.org, david@redhat.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/hugetlb: Convert &folio->page to folio_page(folio, 0)
Date: Thu, 10 Apr 2025 04:48:50 +0100	[thread overview]
Message-ID: <Z_c_onLZDJzqEeiu@casper.infradead.org> (raw)
In-Reply-To: <Z_bvtonNQJ6HIPSA@debian>

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.


  reply	other threads:[~2025-04-10  3:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-09  0:49 nifan.cxl
2025-04-09  3:15 ` Matthew Wilcox
2025-04-09  9:03   ` David Hildenbrand
2025-04-09 17:27   ` Zi Yan
2025-04-09 22:07   ` Fan Ni
2025-04-10  3:48     ` Matthew Wilcox [this message]
2025-04-18 22:42   ` Fan Ni
2025-04-23 18:50     ` Matthew Wilcox
2025-04-23 19:16       ` David Hildenbrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z_c_onLZDJzqEeiu@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=a.manzanares@samsung.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave@stgolabs.net \
    --cc=david@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mcgrof@kernel.org \
    --cc=muchun.song@linux.dev \
    --cc=nifan.cxl@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox