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

From: Vishal Moola (Oracle)
Date: Fri Apr 11 2025 - 15:15:28 EST


On Thu, Apr 10, 2025 at 11:00:31AM -0700, 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>

Aside from the unnecessary folio_test_slab() others have already
mentioned, LGTM.

Reviewed-by: Vishal Moola (Oracle) <vishal.moola@xxxxxxxxx>