aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2024-02-13 03:16:34 -0500
committerAndrew Morton <akpm@linux-foundation.org>2024-02-20 14:20:49 -0800
commit118642d7f606fc9b9c92ee611275420320290ffb (patch)
tree5fbce0b8beec2d3759a1bb2589de8c7eaeba4ef5
parent4f155af0ae4464134bfcfd9f043b6b727c84e947 (diff)
downloadlinux-118642d7f606fc9b9c92ee611275420320290ffb.tar.gz
mm: memcontrol: clarify swapaccount=0 deprecation warning
The swapaccount deprecation warning is throwing false positives. Since we deprecated the knob and defaulted to enabling, the only reports we've been getting are from folks that set swapaccount=1. While this is a nice affirmation that always-enabling was the right choice, we certainly don't want to warn when users request the supported mode. Only warn when disabling is requested, and clarify the warning. [colin.i.king@gmail.com: spelling: "commdandline" -> "commandline"] Link: https://lkml.kernel.org/r/20240215090544.1649201-1-colin.i.king@gmail.com Link: https://lkml.kernel.org/r/20240213081634.3652326-1-hannes@cmpxchg.org Fixes: b25806dcd3d5 ("mm: memcontrol: deprecate swapaccounting=0 mode") Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Reported-by: "Jonas Schäfer" <jonas@wielicki.name> Reported-by: Narcis Garcia <debianlists@actiu.net> Suggested-by: Yosry Ahmed <yosryahmed@google.com> Signed-off-by: Johannes Weiner <hannes@cmpxchg.org> Reviewed-by: Yosry Ahmed <yosryahmed@google.com> Acked-by: Michal Hocko <mhocko@suse.com> Acked-by: Shakeel Butt <shakeelb@google.com> Cc: Roman Gushchin <roman.gushchin@linux.dev> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Notes
Fixes: b25806dcd3d5 ("mm: memcontrol: deprecate swapaccounting=0 mode") # v6.1-rc1 Stable: 8350888b0226 # v6.6.19 Stable: 19e5dc2e6bf7 # v6.1.80 Lore: https://lore.kernel.org/r/20240213081634.3652326-1-hannes@cmpxchg.org # cgroups, linux-mm, lkml Lore: https://lore.kernel.org/r/20240227131613.709997610@linuxfoundation.org # linux-patches, stable Lore: https://lore.kernel.org/r/20240227131631.009790249@linuxfoundation.org # linux-patches, stable Lore: https://lore.kernel.org/r/20240227131636.129546768@linuxfoundation.org # linux-patches, stable
-rw-r--r--mm/memcontrol.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 1ed40f9d3a277e..61932c9215e773 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -7971,9 +7971,13 @@ bool mem_cgroup_swap_full(struct folio *folio)
static int __init setup_swap_account(char *s)
{
- pr_warn_once("The swapaccount= commandline option is deprecated. "
- "Please report your usecase to linux-mm@kvack.org if you "
- "depend on this functionality.\n");
+ bool res;
+
+ if (!kstrtobool(s, &res) && !res)
+ pr_warn_once("The swapaccount=0 commandline option is deprecated "
+ "in favor of configuring swap control via cgroupfs. "
+ "Please report your usecase to linux-mm@kvack.org if you "
+ "depend on this functionality.\n");
return 1;
}
__setup("swapaccount=", setup_swap_account);