linux-stable/Documentation/admin-guide/cgroup-v1
Michal Hocko 4597648fdd mm, memcg: reconsider kmem.limit_in_bytes deprecation
This reverts commits 86327e8eb9 ("memcg: drop kmem.limit_in_bytes") and
partially reverts 58056f7750 ("memcg, kmem: further deprecate
kmem.limit_in_bytes") which have incrementally removed support for the
kernel memory accounting hard limit.  Unfortunately it has turned out that
there is still userspace depending on the existence of
memory.kmem.limit_in_bytes [1].  The underlying functionality is not
really required but the non-existent file just confuses the userspace
which fails in the result.  The patch to fix this on the userspace side
has been submitted but it is hard to predict how it will propagate through
the maze of 3rd party consumers of the software.

Now, reverting alone 86327e8eb9 is not an option because there is
another set of userspace which cannot cope with ENOTSUPP returned when
writing to the file.  Therefore we have to go and revisit 58056f7750 as
well.  There are two ways to go ahead.  Either we give up on the
deprecation and fully revert 58056f7750 as well or we can keep
kmem.limit_in_bytes but make the write a noop and warn about the fact. 
This should work for both known breaking workloads which depend on the
existence but do not depend on the hard limit enforcement.

Note to backporters to stable trees.  a8c49af3be ("memcg: add per-memcg
total kernel memory stat") introduced in 4.18 has added memcg_account_kmem
so the accounting is not done by obj_cgroup_charge_pages directly for v1
anymore.  Prior kernels need to add it explicitly (thanks to Johannes for
pointing this out).

[akpm@linux-foundation.org: fix build - remove unused local]
Link: http://lkml.kernel.org/r/20230920081101.GA12096@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net [1]
Link: https://lkml.kernel.org/r/ZRE5VJozPZt9bRPy@dhcp22.suse.cz
Fixes: 86327e8eb9 ("memcg: drop kmem.limit_in_bytes")
Fixes: 58056f7750 ("memcg, kmem: further deprecate kmem.limit_in_bytes")
Signed-off-by: Michal Hocko <mhocko@suse.com>
Acked-by: Shakeel Butt <shakeelb@google.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jeremi Piotrowski <jpiotrowski@linux.microsoft.com>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Tejun heo <tj@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2023-09-29 17:20:47 -07:00
..
blkio-controller.rst Documentation: admin-guide: correct spelling 2023-02-02 11:04:42 -07:00
cgroups.rst docs: cgroup-v1: use numbered lists for user interface setup 2023-01-05 07:38:11 -10:00
cpuacct.rst
cpusets.rst docs: cgroup-v1/cpusets: update libcgroup project link 2023-04-14 06:55:48 -10:00
devices.rst
freezer-subsystem.rst
hugetlb.rst hugetlb: add hugetlb.*.numa_stat file 2022-01-15 16:30:29 +02:00
index.rst cgroup: Miscellaneous cgroup documentation. 2021-04-04 13:34:46 -04:00
memcg_test.rst docs: cgroup-v1: replace dead CONFIG_MEM_RES_CTRL_SWAP symbol 2023-07-31 09:55:12 -06:00
memory.rst mm, memcg: reconsider kmem.limit_in_bytes deprecation 2023-09-29 17:20:47 -07:00
misc.rst cgroup: Miscellaneous cgroup documentation. 2021-04-04 13:34:46 -04:00
net_cls.rst
net_prio.rst
pids.rst
rdma.rst Documentation/admin-guide: cgroup-v1/rdma: drop doubled word 2020-07-05 14:01:48 -06:00