Skip to content

Commit

Permalink
mm: memcontrol: clarify swapaccount=0 deprecation warning
Browse files Browse the repository at this point in the history
commit 118642d upstream.

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: b25806d ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
hnaz authored and gregkh committed Mar 1, 2024
1 parent 3c4441b commit 8350888
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -7613,9 +7613,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);
Expand Down

0 comments on commit 8350888

Please sign in to comment.