Re: [PATCH v2 1/3] mm/swap: colocate page-cluster sysctl with swap readahead
From: Barry Song
Date: Sun May 31 2026 - 18:07:08 EST
On Sun, May 31, 2026 at 5:50 PM Jianyue Wu <wujianyue000@xxxxxxxxx> wrote:
>
> page_cluster and the vm.page-cluster sysctl are only used by swap-in
> readahead in swap_state.c. Move them out of swap.c together with
> swap_readahead_setup(), and make page_cluster static to that file.
>
> Rename swap_setup() while moving it as well. The helper is internal to
> MM and now only sets up swap readahead defaults and its sysctl hook, so
> the more specific name matches its reduced scope.
>
> Signed-off-by: Jianyue Wu <wujianyue000@xxxxxxxxx>
> ---
> include/linux/swap.h | 2 +-
> mm/swap.c | 36 ------------------------------------
> mm/swap.h | 2 --
> mm/swap_state.c | 37 +++++++++++++++++++++++++++++++++++++
> mm/vmscan.c | 2 +-
> 5 files changed, 39 insertions(+), 40 deletions(-)
>
> diff --git a/include/linux/swap.h b/include/linux/swap.h
> index 636d94108166..c36f72877e8b 100644
> --- a/include/linux/swap.h
> +++ b/include/linux/swap.h
> @@ -345,7 +345,7 @@ extern void lru_add_drain_cpu_zone(struct zone *zone);
> extern void lru_add_drain_all(void);
> void folio_deactivate(struct folio *folio);
> void folio_mark_lazyfree(struct folio *folio);
> -extern void swap_setup(void);
> +extern void swap_readahead_setup(void);
Can we move this to mm/swap.h?