Message ID | 20250319064148.774406-3-jingxiangzeng.cas@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | add option to restore swap account to cgroupv1 mode | expand |
On Wed, Mar 19, 2025 at 02:41:45PM +0800, Jingxiang Zeng wrote: > From: Zeng Jingxiang <linuszeng@tencent.com> > > Added cgroup.memsw_account_on_dfl startup parameter, which > is off by default. When enabled in cgroupv2 mode, the memory > accounting mode of swap will be reverted to cgroupv1 mode. > > Signed-off-by: Zeng Jingxiang <linuszeng@tencent.com> > --- > include/linux/memcontrol.h | 4 +++- > mm/memcontrol.c | 11 +++++++++++ > 2 files changed, 14 insertions(+), 1 deletion(-) > > diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h > index dcb087ee6e8d..96f2fad1c351 100644 > --- a/include/linux/memcontrol.h > +++ b/include/linux/memcontrol.h > @@ -62,10 +62,12 @@ struct mem_cgroup_reclaim_cookie { > > #ifdef CONFIG_MEMCG > > +DECLARE_STATIC_KEY_FALSE(memsw_account_on_dfl); > /* Whether enable memory+swap account in cgroupv2 */ > static inline bool do_memsw_account_on_dfl(void) > { > - return IS_ENABLED(CONFIG_MEMSW_ACCOUNT_ON_DFL); > + return IS_ENABLED(CONFIG_MEMSW_ACCOUNT_ON_DFL) > + || static_branch_unlikely(&memsw_account_on_dfl); Why || in above condition? Shouldn't it be && ? > } > > #define MEM_CGROUP_ID_SHIFT 16 > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > index 768d6b15dbfa..c1171fb2bfd6 100644 > --- a/mm/memcontrol.c > +++ b/mm/memcontrol.c > @@ -5478,3 +5478,14 @@ static int __init mem_cgroup_swap_init(void) > subsys_initcall(mem_cgroup_swap_init); > > #endif /* CONFIG_SWAP */ > + > +DEFINE_STATIC_KEY_FALSE(memsw_account_on_dfl); > +static int __init memsw_account_on_dfl_setup(char *s) > +{ > + if (!strcmp(s, "1")) > + static_branch_enable(&memsw_account_on_dfl); > + else if (!strcmp(s, "0")) > + static_branch_disable(&memsw_account_on_dfl); > + return 1; > +} > +__setup("cgroup.memsw_account_on_dfl=", memsw_account_on_dfl_setup); Please keep the above in memcontrol-v1.c > + > \ No newline at end of file > -- > 2.41.1 >
Shakeel Butt <shakeel.butt@linux.dev> writes: > On Wed, Mar 19, 2025 at 02:41:45PM +0800, Jingxiang Zeng wrote: >> From: Zeng Jingxiang <linuszeng@tencent.com> >> >> Added cgroup.memsw_account_on_dfl startup parameter, which >> is off by default. When enabled in cgroupv2 mode, the memory >> accounting mode of swap will be reverted to cgroupv1 mode. >> >> Signed-off-by: Zeng Jingxiang <linuszeng@tencent.com> >> --- >> include/linux/memcontrol.h | 4 +++- >> mm/memcontrol.c | 11 +++++++++++ >> 2 files changed, 14 insertions(+), 1 deletion(-) >> >> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h >> index dcb087ee6e8d..96f2fad1c351 100644 >> --- a/include/linux/memcontrol.h >> +++ b/include/linux/memcontrol.h >> @@ -62,10 +62,12 @@ struct mem_cgroup_reclaim_cookie { >> >> #ifdef CONFIG_MEMCG >> >> +DECLARE_STATIC_KEY_FALSE(memsw_account_on_dfl); >> /* Whether enable memory+swap account in cgroupv2 */ >> static inline bool do_memsw_account_on_dfl(void) >> { >> - return IS_ENABLED(CONFIG_MEMSW_ACCOUNT_ON_DFL); >> + return IS_ENABLED(CONFIG_MEMSW_ACCOUNT_ON_DFL) >> + || static_branch_unlikely(&memsw_account_on_dfl); > > Why || in above condition? Shouldn't it be && ? > >> } >> >> #define MEM_CGROUP_ID_SHIFT 16 >> diff --git a/mm/memcontrol.c b/mm/memcontrol.c >> index 768d6b15dbfa..c1171fb2bfd6 100644 >> --- a/mm/memcontrol.c >> +++ b/mm/memcontrol.c >> @@ -5478,3 +5478,14 @@ static int __init mem_cgroup_swap_init(void) >> subsys_initcall(mem_cgroup_swap_init); >> >> #endif /* CONFIG_SWAP */ >> + >> +DEFINE_STATIC_KEY_FALSE(memsw_account_on_dfl); >> +static int __init memsw_account_on_dfl_setup(char *s) >> +{ >> + if (!strcmp(s, "1")) >> + static_branch_enable(&memsw_account_on_dfl); >> + else if (!strcmp(s, "0")) >> + static_branch_disable(&memsw_account_on_dfl); >> + return 1; >> +} >> +__setup("cgroup.memsw_account_on_dfl=", memsw_account_on_dfl_setup); > > Please keep the above in memcontrol-v1.c Hm, I'm not sure about this. This feature might be actually useful with cgroup v2, as some companies are dependent on the old cgroup v1 semantics here but otherwise would prefer to move to v2. In other words, I see it as a cgroup v2 feature, not as a cgroup v1. So there is no reason to move it into the cgroup v1 code. I think it deserves a separate config option (if we're really concerned about the memory overhead in struct mem_cgroup) or IMO better a boot/mount time option. Thanks!
On Thu, 20 Mar 2025 at 06:32, Roman Gushchin <roman.gushchin@linux.dev> wrote: > > Shakeel Butt <shakeel.butt@linux.dev> writes: > > > On Wed, Mar 19, 2025 at 02:41:45PM +0800, Jingxiang Zeng wrote: > >> From: Zeng Jingxiang <linuszeng@tencent.com> > >> > >> Added cgroup.memsw_account_on_dfl startup parameter, which > >> is off by default. When enabled in cgroupv2 mode, the memory > >> accounting mode of swap will be reverted to cgroupv1 mode. > >> > >> Signed-off-by: Zeng Jingxiang <linuszeng@tencent.com> > >> --- > >> include/linux/memcontrol.h | 4 +++- > >> mm/memcontrol.c | 11 +++++++++++ > >> 2 files changed, 14 insertions(+), 1 deletion(-) > >> > >> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h > >> index dcb087ee6e8d..96f2fad1c351 100644 > >> --- a/include/linux/memcontrol.h > >> +++ b/include/linux/memcontrol.h > >> @@ -62,10 +62,12 @@ struct mem_cgroup_reclaim_cookie { > >> > >> #ifdef CONFIG_MEMCG > >> > >> +DECLARE_STATIC_KEY_FALSE(memsw_account_on_dfl); > >> /* Whether enable memory+swap account in cgroupv2 */ > >> static inline bool do_memsw_account_on_dfl(void) > >> { > >> - return IS_ENABLED(CONFIG_MEMSW_ACCOUNT_ON_DFL); > >> + return IS_ENABLED(CONFIG_MEMSW_ACCOUNT_ON_DFL) > >> + || static_branch_unlikely(&memsw_account_on_dfl); > > > > Why || in above condition? Shouldn't it be && ? > > > >> } > >> > >> #define MEM_CGROUP_ID_SHIFT 16 > >> diff --git a/mm/memcontrol.c b/mm/memcontrol.c > >> index 768d6b15dbfa..c1171fb2bfd6 100644 > >> --- a/mm/memcontrol.c > >> +++ b/mm/memcontrol.c > >> @@ -5478,3 +5478,14 @@ static int __init mem_cgroup_swap_init(void) > >> subsys_initcall(mem_cgroup_swap_init); > >> > >> #endif /* CONFIG_SWAP */ > >> + > >> +DEFINE_STATIC_KEY_FALSE(memsw_account_on_dfl); > >> +static int __init memsw_account_on_dfl_setup(char *s) > >> +{ > >> + if (!strcmp(s, "1")) > >> + static_branch_enable(&memsw_account_on_dfl); > >> + else if (!strcmp(s, "0")) > >> + static_branch_disable(&memsw_account_on_dfl); > >> + return 1; > >> +} > >> +__setup("cgroup.memsw_account_on_dfl=", memsw_account_on_dfl_setup); > > > > Please keep the above in memcontrol-v1.c > > Hm, I'm not sure about this. This feature might be actually useful with > cgroup v2, as some companies are dependent on the old cgroup v1 > semantics here but otherwise would prefer to move to v2. > In other words, I see it as a cgroup v2 feature, not as a cgroup v1. > So there is no reason to move it into the cgroup v1 code. Yes, this is mainly intended for use with v2. > > I think it deserves a separate config option (if we're really concerned > about the memory overhead in struct mem_cgroup) or IMO better a > boot/mount time option. > > Thanks! >
On Thu, 20 Mar 2025 at 03:34, Shakeel Butt <shakeel.butt@linux.dev> wrote: > > On Wed, Mar 19, 2025 at 02:41:45PM +0800, Jingxiang Zeng wrote: > > From: Zeng Jingxiang <linuszeng@tencent.com> > > > > Added cgroup.memsw_account_on_dfl startup parameter, which > > is off by default. When enabled in cgroupv2 mode, the memory > > accounting mode of swap will be reverted to cgroupv1 mode. > > > > Signed-off-by: Zeng Jingxiang <linuszeng@tencent.com> > > --- > > include/linux/memcontrol.h | 4 +++- > > mm/memcontrol.c | 11 +++++++++++ > > 2 files changed, 14 insertions(+), 1 deletion(-) > > > > diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h > > index dcb087ee6e8d..96f2fad1c351 100644 > > --- a/include/linux/memcontrol.h > > +++ b/include/linux/memcontrol.h > > @@ -62,10 +62,12 @@ struct mem_cgroup_reclaim_cookie { > > > > #ifdef CONFIG_MEMCG > > > > +DECLARE_STATIC_KEY_FALSE(memsw_account_on_dfl); > > /* Whether enable memory+swap account in cgroupv2 */ > > static inline bool do_memsw_account_on_dfl(void) > > { > > - return IS_ENABLED(CONFIG_MEMSW_ACCOUNT_ON_DFL); > > + return IS_ENABLED(CONFIG_MEMSW_ACCOUNT_ON_DFL) > > + || static_branch_unlikely(&memsw_account_on_dfl); > > Why || in above condition? Shouldn't it be && ? It seems that changing it to && is better, Thanks. > > > } > > > > #define MEM_CGROUP_ID_SHIFT 16 > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c > > index 768d6b15dbfa..c1171fb2bfd6 100644 > > --- a/mm/memcontrol.c > > +++ b/mm/memcontrol.c > > @@ -5478,3 +5478,14 @@ static int __init mem_cgroup_swap_init(void) > > subsys_initcall(mem_cgroup_swap_init); > > > > #endif /* CONFIG_SWAP */ > > + > > +DEFINE_STATIC_KEY_FALSE(memsw_account_on_dfl); > > +static int __init memsw_account_on_dfl_setup(char *s) > > +{ > > + if (!strcmp(s, "1")) > > + static_branch_enable(&memsw_account_on_dfl); > > + else if (!strcmp(s, "0")) > > + static_branch_disable(&memsw_account_on_dfl); > > + return 1; > > +} > > +__setup("cgroup.memsw_account_on_dfl=", memsw_account_on_dfl_setup); > > Please keep the above in memcontrol-v1.c > > > + > > \ No newline at end of file > > -- > > 2.41.1 > > >
On Wed, Mar 19, 2025 at 10:30:20PM +0000, Roman Gushchin wrote: > Shakeel Butt <shakeel.butt@linux.dev> writes: > > > On Wed, Mar 19, 2025 at 02:41:45PM +0800, Jingxiang Zeng wrote: > >> From: Zeng Jingxiang <linuszeng@tencent.com> > >> > >> Added cgroup.memsw_account_on_dfl startup parameter, which > >> is off by default. When enabled in cgroupv2 mode, the memory > >> accounting mode of swap will be reverted to cgroupv1 mode. > >> > >> Signed-off-by: Zeng Jingxiang <linuszeng@tencent.com> > >> --- > >> include/linux/memcontrol.h | 4 +++- > >> mm/memcontrol.c | 11 +++++++++++ > >> 2 files changed, 14 insertions(+), 1 deletion(-) > >> > >> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h > >> index dcb087ee6e8d..96f2fad1c351 100644 > >> --- a/include/linux/memcontrol.h > >> +++ b/include/linux/memcontrol.h > >> @@ -62,10 +62,12 @@ struct mem_cgroup_reclaim_cookie { > >> > >> #ifdef CONFIG_MEMCG > >> > >> +DECLARE_STATIC_KEY_FALSE(memsw_account_on_dfl); > >> /* Whether enable memory+swap account in cgroupv2 */ > >> static inline bool do_memsw_account_on_dfl(void) > >> { > >> - return IS_ENABLED(CONFIG_MEMSW_ACCOUNT_ON_DFL); > >> + return IS_ENABLED(CONFIG_MEMSW_ACCOUNT_ON_DFL) > >> + || static_branch_unlikely(&memsw_account_on_dfl); > > > > Why || in above condition? Shouldn't it be && ? > > > >> } > >> > >> #define MEM_CGROUP_ID_SHIFT 16 > >> diff --git a/mm/memcontrol.c b/mm/memcontrol.c > >> index 768d6b15dbfa..c1171fb2bfd6 100644 > >> --- a/mm/memcontrol.c > >> +++ b/mm/memcontrol.c > >> @@ -5478,3 +5478,14 @@ static int __init mem_cgroup_swap_init(void) > >> subsys_initcall(mem_cgroup_swap_init); > >> > >> #endif /* CONFIG_SWAP */ > >> + > >> +DEFINE_STATIC_KEY_FALSE(memsw_account_on_dfl); > >> +static int __init memsw_account_on_dfl_setup(char *s) > >> +{ > >> + if (!strcmp(s, "1")) > >> + static_branch_enable(&memsw_account_on_dfl); > >> + else if (!strcmp(s, "0")) > >> + static_branch_disable(&memsw_account_on_dfl); > >> + return 1; > >> +} > >> +__setup("cgroup.memsw_account_on_dfl=", memsw_account_on_dfl_setup); > > > > Please keep the above in memcontrol-v1.c > > Hm, I'm not sure about this. This feature might be actually useful with > cgroup v2, as some companies are dependent on the old cgroup v1 > semantics here but otherwise would prefer to move to v2. > In other words, I see it as a cgroup v2 feature, not as a cgroup v1. > So there is no reason to move it into the cgroup v1 code. Agreed. Let's think of this proposal as making memsw tracking and control a full-fledged v2 feature. > I think it deserves a separate config option (if we're really concerned > about the memory overhead in struct mem_cgroup) or IMO better a > boot/mount time option. Yeah, a config option forces distros to enable it :/ I'm hesitant to agree with making it optional in any manner. If you consider the functionality that is implemented, the overhead should be fairly minimal. It isn't right now, because page_counter contains a ton of stuff that isn't applicable to this new user. That overhead is still paid for unnecessarily by users who _do_ need to enable it. It seems like a good opportunity to refactor struct page_counter.
Johannes Weiner <hannes@cmpxchg.org> writes: > On Wed, Mar 19, 2025 at 10:30:20PM +0000, Roman Gushchin wrote: >> Shakeel Butt <shakeel.butt@linux.dev> writes: >> >> > On Wed, Mar 19, 2025 at 02:41:45PM +0800, Jingxiang Zeng wrote: >> >> From: Zeng Jingxiang <linuszeng@tencent.com> >> >> >> >> Added cgroup.memsw_account_on_dfl startup parameter, which >> >> is off by default. When enabled in cgroupv2 mode, the memory >> >> accounting mode of swap will be reverted to cgroupv1 mode. >> >> >> >> Signed-off-by: Zeng Jingxiang <linuszeng@tencent.com> >> >> --- >> >> include/linux/memcontrol.h | 4 +++- >> >> mm/memcontrol.c | 11 +++++++++++ >> >> 2 files changed, 14 insertions(+), 1 deletion(-) >> >> >> >> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h >> >> index dcb087ee6e8d..96f2fad1c351 100644 >> >> --- a/include/linux/memcontrol.h >> >> +++ b/include/linux/memcontrol.h >> >> @@ -62,10 +62,12 @@ struct mem_cgroup_reclaim_cookie { >> >> >> >> #ifdef CONFIG_MEMCG >> >> >> >> +DECLARE_STATIC_KEY_FALSE(memsw_account_on_dfl); >> >> /* Whether enable memory+swap account in cgroupv2 */ >> >> static inline bool do_memsw_account_on_dfl(void) >> >> { >> >> - return IS_ENABLED(CONFIG_MEMSW_ACCOUNT_ON_DFL); >> >> + return IS_ENABLED(CONFIG_MEMSW_ACCOUNT_ON_DFL) >> >> + || static_branch_unlikely(&memsw_account_on_dfl); >> > >> > Why || in above condition? Shouldn't it be && ? >> > >> >> } >> >> >> >> #define MEM_CGROUP_ID_SHIFT 16 >> >> diff --git a/mm/memcontrol.c b/mm/memcontrol.c >> >> index 768d6b15dbfa..c1171fb2bfd6 100644 >> >> --- a/mm/memcontrol.c >> >> +++ b/mm/memcontrol.c >> >> @@ -5478,3 +5478,14 @@ static int __init mem_cgroup_swap_init(void) >> >> subsys_initcall(mem_cgroup_swap_init); >> >> >> >> #endif /* CONFIG_SWAP */ >> >> + >> >> +DEFINE_STATIC_KEY_FALSE(memsw_account_on_dfl); >> >> +static int __init memsw_account_on_dfl_setup(char *s) >> >> +{ >> >> + if (!strcmp(s, "1")) >> >> + static_branch_enable(&memsw_account_on_dfl); >> >> + else if (!strcmp(s, "0")) >> >> + static_branch_disable(&memsw_account_on_dfl); >> >> + return 1; >> >> +} >> >> +__setup("cgroup.memsw_account_on_dfl=", memsw_account_on_dfl_setup); >> > >> > Please keep the above in memcontrol-v1.c >> >> Hm, I'm not sure about this. This feature might be actually useful with >> cgroup v2, as some companies are dependent on the old cgroup v1 >> semantics here but otherwise would prefer to move to v2. >> In other words, I see it as a cgroup v2 feature, not as a cgroup v1. >> So there is no reason to move it into the cgroup v1 code. > > Agreed. Let's think of this proposal as making memsw tracking and > control a full-fledged v2 feature. > >> I think it deserves a separate config option (if we're really concerned >> about the memory overhead in struct mem_cgroup) or IMO better a >> boot/mount time option. > > Yeah, a config option forces distros to enable it :/ > > I'm hesitant to agree with making it optional in any manner. If you > consider the functionality that is implemented, the overhead should be > fairly minimal. It isn't right now, because page_counter contains a > ton of stuff that isn't applicable to this new user. That overhead is > still paid for unnecessarily by users who _do_ need to enable it. Agree. Memcg is already huge, so another page_counter won't add a lot percentage-wise. > > It seems like a good opportunity to refactor struct page_counter. I don't think it's a hard dependency here, but otherwise fully agree. Thanks!
On Thu, Mar 20, 2025 at 10:28:46AM -0400, Johannes Weiner wrote: > On Wed, Mar 19, 2025 at 10:30:20PM +0000, Roman Gushchin wrote: > > Shakeel Butt <shakeel.butt@linux.dev> writes: > > > > > On Wed, Mar 19, 2025 at 02:41:45PM +0800, Jingxiang Zeng wrote: > > >> From: Zeng Jingxiang <linuszeng@tencent.com> > > >> > > >> Added cgroup.memsw_account_on_dfl startup parameter, which > > >> is off by default. When enabled in cgroupv2 mode, the memory > > >> accounting mode of swap will be reverted to cgroupv1 mode. > > >> > > >> Signed-off-by: Zeng Jingxiang <linuszeng@tencent.com> > > >> --- > > >> include/linux/memcontrol.h | 4 +++- > > >> mm/memcontrol.c | 11 +++++++++++ > > >> 2 files changed, 14 insertions(+), 1 deletion(-) > > >> > > >> diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h > > >> index dcb087ee6e8d..96f2fad1c351 100644 > > >> --- a/include/linux/memcontrol.h > > >> +++ b/include/linux/memcontrol.h > > >> @@ -62,10 +62,12 @@ struct mem_cgroup_reclaim_cookie { > > >> > > >> #ifdef CONFIG_MEMCG > > >> > > >> +DECLARE_STATIC_KEY_FALSE(memsw_account_on_dfl); > > >> /* Whether enable memory+swap account in cgroupv2 */ > > >> static inline bool do_memsw_account_on_dfl(void) > > >> { > > >> - return IS_ENABLED(CONFIG_MEMSW_ACCOUNT_ON_DFL); > > >> + return IS_ENABLED(CONFIG_MEMSW_ACCOUNT_ON_DFL) > > >> + || static_branch_unlikely(&memsw_account_on_dfl); > > > > > > Why || in above condition? Shouldn't it be && ? > > > > > >> } > > >> > > >> #define MEM_CGROUP_ID_SHIFT 16 > > >> diff --git a/mm/memcontrol.c b/mm/memcontrol.c > > >> index 768d6b15dbfa..c1171fb2bfd6 100644 > > >> --- a/mm/memcontrol.c > > >> +++ b/mm/memcontrol.c > > >> @@ -5478,3 +5478,14 @@ static int __init mem_cgroup_swap_init(void) > > >> subsys_initcall(mem_cgroup_swap_init); > > >> > > >> #endif /* CONFIG_SWAP */ > > >> + > > >> +DEFINE_STATIC_KEY_FALSE(memsw_account_on_dfl); > > >> +static int __init memsw_account_on_dfl_setup(char *s) > > >> +{ > > >> + if (!strcmp(s, "1")) > > >> + static_branch_enable(&memsw_account_on_dfl); > > >> + else if (!strcmp(s, "0")) > > >> + static_branch_disable(&memsw_account_on_dfl); > > >> + return 1; > > >> +} > > >> +__setup("cgroup.memsw_account_on_dfl=", memsw_account_on_dfl_setup); > > > > > > Please keep the above in memcontrol-v1.c > > > > Hm, I'm not sure about this. This feature might be actually useful with > > cgroup v2, as some companies are dependent on the old cgroup v1 > > semantics here but otherwise would prefer to move to v2. > > In other words, I see it as a cgroup v2 feature, not as a cgroup v1. > > So there is no reason to move it into the cgroup v1 code. > > Agreed. Let's think of this proposal as making memsw tracking and > control a full-fledged v2 feature. > Sounds good. However I want us to discuss and decide the semantics of memsw from scratch rather than adopting v1 semantics. Particularly I don't like the failure of setting memsw limit on v1. Also we should discuss how memsw and swap limits would interact and what would be the appropriate default.
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index dcb087ee6e8d..96f2fad1c351 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -62,10 +62,12 @@ struct mem_cgroup_reclaim_cookie { #ifdef CONFIG_MEMCG +DECLARE_STATIC_KEY_FALSE(memsw_account_on_dfl); /* Whether enable memory+swap account in cgroupv2 */ static inline bool do_memsw_account_on_dfl(void) { - return IS_ENABLED(CONFIG_MEMSW_ACCOUNT_ON_DFL); + return IS_ENABLED(CONFIG_MEMSW_ACCOUNT_ON_DFL) + || static_branch_unlikely(&memsw_account_on_dfl); } #define MEM_CGROUP_ID_SHIFT 16 diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 768d6b15dbfa..c1171fb2bfd6 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -5478,3 +5478,14 @@ static int __init mem_cgroup_swap_init(void) subsys_initcall(mem_cgroup_swap_init); #endif /* CONFIG_SWAP */ + +DEFINE_STATIC_KEY_FALSE(memsw_account_on_dfl); +static int __init memsw_account_on_dfl_setup(char *s) +{ + if (!strcmp(s, "1")) + static_branch_enable(&memsw_account_on_dfl); + else if (!strcmp(s, "0")) + static_branch_disable(&memsw_account_on_dfl); + return 1; +} +__setup("cgroup.memsw_account_on_dfl=", memsw_account_on_dfl_setup);