From: Matthew Wilcox <willy@infradead.org>
To: nifan.cxl@gmail.com
Cc: 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, will@kernel.org,
aneesh.kumar@kernel.org, hca@linux.ibm.com, gor@linux.ibm.com,
linux-s390@vger.kernel.org, ziy@nvidia.com,
Fan Ni <fan.ni@samsung.com>,
"Vishal Moola (Oracle)" <vishal.moola@gmail.com>
Subject: Re: [PATCH v2] mm: Introduce free_folio_and_swap_cache() to replace free_page_and_swap_cache()
Date: Sun, 13 Apr 2025 22:34:32 +0100 [thread overview]
Message-ID: <Z_wt6M4P0nkM5y8Y@casper.infradead.org> (raw)
In-Reply-To: <20250413042316.533763-1-nifan.cxl@gmail.com>
On Sat, Apr 12, 2025 at 09:22:21PM -0700, nifan.cxl@gmail.com wrote:
> From: Fan Ni <fan.ni@samsung.com>
>
> The function free_page_and_swap_cache() takes a struct page pointer as
> input parameter, but it will immediately convert it to folio and all
> operations following within use folio instead of page. It makes more
> sense to pass in folio directly.
>
> Introduce free_folio_and_swap_cache(), which takes folio as input to
> replace free_page_and_swap_cache(). And apply it to all occurrences
> where free_page_and_swap_cache() was used.
>
> Signed-off-by: Fan Ni <fan.ni@samsung.com>
> Reviewed-by: Zi Yan <ziy@nvidia.com>
> Acked-by: Davidlohr Bueso <dave@stgolabs.net>
> Reviewed-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> @@ -522,8 +522,8 @@ static inline void put_swap_device(struct swap_info_struct *si)
> do { (val)->freeswap = (val)->totalswap = 0; } while (0)
> /* only sparc can not include linux/pagemap.h in this file
> * so leave put_page and release_pages undeclared... */
> -#define free_page_and_swap_cache(page) \
> - put_page(page)
> +#define free_folio_and_swap_cache(folio) \
> + folio_put(folio)
Since you're respinning this patch anyway, you can delete the comment
about sparc. This file has included pagemap.h since 4ee60ec156d9
in 2021.
prev parent reply other threads:[~2025-04-13 21:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-13 4:22 nifan.cxl
2025-04-13 20:05 ` David Hildenbrand
2025-04-13 21:34 ` Matthew Wilcox [this message]
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_wt6M4P0nkM5y8Y@casper.infradead.org \
--to=willy@infradead.org \
--cc=a.manzanares@samsung.com \
--cc=akpm@linux-foundation.org \
--cc=aneesh.kumar@kernel.org \
--cc=dave@stgolabs.net \
--cc=david@redhat.com \
--cc=fan.ni@samsung.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-s390@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=nifan.cxl@gmail.com \
--cc=vishal.moola@gmail.com \
--cc=will@kernel.org \
--cc=ziy@nvidia.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