mm: memcontrol: deprecate swapaccounting=0 mode
authorJohannes Weiner <hannes@cmpxchg.org>
Mon, 26 Sep 2022 13:57:02 +0000 (09:57 -0400)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 3 Oct 2022 21:03:36 +0000 (14:03 -0700)
commitb25806dcd3d5248833f7d2544ee29a701735159f
treebb32cd57fa1d5c92694e1cfa1ab619c8a6bea28f
parentc91bdc9358992856721ff77887202a7e80b7ab22
mm: memcontrol: deprecate swapaccounting=0 mode

The swapaccounting= commandline option already does very little today.  To
close a trivial containment failure case, the swap ownership tracking part
of the swap controller has recently become mandatory (see commit
2d1c498072de ("mm: memcontrol: make swap tracking an integral part of
memory control") for details), which makes up the majority of the work
during swapout, swapin, and the swap slot map.

The only thing left under this flag is the page_counter operations and the
visibility of the swap control files in the first place, which are rather
meager savings.  There also aren't many scenarios, if any, where
controlling the memory of a cgroup while allowing it unlimited access to a
global swap space is a workable resource isolation strategy.

On the other hand, there have been several bugs and confusion around the
many possible swap controller states (cgroup1 vs cgroup2 behavior, memory
accounting without swap accounting, memcg runtime disabled).

This puts the maintenance overhead of retaining the toggle above its
practical benefits.  Deprecate it.

Link: https://lkml.kernel.org/r/20220926135704.400818-3-hannes@cmpxchg.org
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Suggested-by: Shakeel Butt <shakeelb@google.com>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Documentation/admin-guide/kernel-parameters.txt
mm/memcontrol.c