On Wed, Mar 19, 2025 at 12:29:11PM -0700, Shakeel Butt wrote: > On Wed, Mar 19, 2025 at 02:41:44PM +0800, Jingxiang Zeng wrote: > > From: Zeng Jingxiang <linuszeng@xxxxxxxxxxx> > > > > Added SWAP_CHARGE_V1_MODE config, which is disabled by default. > > When enabled in cgroupv2 mode, the memory accounting method of > > swap will be restored to cgroupv1 mode. > > > > Signed-off-by: Zeng Jingxiang <linuszeng@xxxxxxxxxxx> > > --- > > include/linux/memcontrol.h | 6 ++++++ > > init/Kconfig | 16 ++++++++++++++++ > > 2 files changed, 22 insertions(+) > > > > diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h > > index 53364526d877..dcb087ee6e8d 100644 > > --- a/include/linux/memcontrol.h > > +++ b/include/linux/memcontrol.h > > @@ -62,6 +62,12 @@ struct mem_cgroup_reclaim_cookie { > > > > #ifdef CONFIG_MEMCG > > > > +/* Whether enable memory+swap account in cgroupv2 */ > > +static inline bool do_memsw_account_on_dfl(void) > > +{ > > + return IS_ENABLED(CONFIG_MEMSW_ACCOUNT_ON_DFL); > > +} > > + > > Please move the above to memcontrol-v1.h file. > And under CONFIG_MEMCG_V1 similar to do_memsw_account().