Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Johannes Weiner and committed by
Andrew Morton
118642d7 4f155af0

+7 -3
+7 -3
mm/memcontrol.c
··· 7971 7971 7972 7972 static int __init setup_swap_account(char *s) 7973 7973 { 7974 - pr_warn_once("The swapaccount= commandline option is deprecated. " 7975 - "Please report your usecase to linux-mm@kvack.org if you " 7976 - "depend on this functionality.\n"); 7974 + bool res; 7975 + 7976 + if (!kstrtobool(s, &res) && !res) 7977 + pr_warn_once("The swapaccount=0 commandline option is deprecated " 7978 + "in favor of configuring swap control via cgroupfs. " 7979 + "Please report your usecase to linux-mm@kvack.org if you " 7980 + "depend on this functionality.\n"); 7977 7981 return 1; 7978 7982 } 7979 7983 __setup("swapaccount=", setup_swap_account);