Re: [PATCH] mm: Introduce free_folio_and_swap_cache() to replace free_page_and_swap_cache()

From: Davidlohr Bueso
Date: Thu Apr 10 2025 - 16:32:03 EST


On Thu, 10 Apr 2025, nifan.cxl@xxxxxxxxx wrote:

From: Fan Ni <fan.ni@xxxxxxxxxxx>

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@xxxxxxxxxxx>

With the already pointed out issues, this looks good.

Acked-by: Davidlohr Bueso <dave@xxxxxxxxxxxx>