Re: [PATCH v8 1/3] mm/swap: colocate page-cluster sysctl with swap readahead

From: Jianyue Wu

Date: Tue Jul 07 2026 - 20:58:58 EST


On Wed, Jul 8, 2026 at 12:41 AM Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote:
>
> On Wed, Jul 08, 2026 at 12:11:27AM +0800, Jianyue Wu wrote:
> > +++ b/mm/swap.h
> > @@ -336,6 +334,7 @@ static inline unsigned int folio_swap_flags(struct folio *folio)
> >
> > #else /* CONFIG_SWAP */
> > struct swap_iocb;
> > +
> > static inline struct swap_cluster_info *swap_cluster_lock(
> > struct swap_info_struct *si, pgoff_t offset, bool irq)
> > {
>
> This change is not related; please drop it.
>
> > @@ -985,6 +990,38 @@ struct folio *swapin_readahead(swp_entry_t entry, gfp_t gfp_mask,
> > return folio;
> > }
> >
> > +static const struct ctl_table swap_readahead_sysctl_table[] = {
> > + {
> > + .procname = "page-cluster",
> > + .data = &page_cluster,
> > + .maxlen = sizeof(int),
> > + .mode = 0644,
> > + .proc_handler = proc_dointvec_minmax,
> > + .extra1 = SYSCTL_ZERO,
> > + .extra2 = (void *)&page_cluster_max,
> > + }
> > +};
> > +
> > +/**
> > + * swap_readahead_setup - defaults and sysctl for swap cache readahead clustering
> > + */
>
> This comment:
> - Does not need to be kernel-doc formatted as it is static
> - Only contains information that is obvious (at least to me).
> I would drop it entirely.
>

Hello Matthew,

Ah, yes, sorry for that, both make sense. Thanks, I'll drop the
unrelated blank line and remove the redundant comment in
the next version.

Best regards,
Jianyue