summaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-09-20 12:57:00 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-09-23 11:11:12 +0200
commit45ea58f9dbf8faecc733e4f1db06a55fc0e7e6a7 (patch)
tree33b6e68a3034417a2c63e090af38cad17c82c033 /mm/memcontrol.c
parent4422080e777e3fa740e2920fe4de53cfad7fcef2 (diff)
downloadlinux-stable-45ea58f9dbf8faecc733e4f1db06a55fc0e7e6a7.tar.gz
linux-stable-45ea58f9dbf8faecc733e4f1db06a55fc0e7e6a7.tar.bz2
linux-stable-45ea58f9dbf8faecc733e4f1db06a55fc0e7e6a7.zip
Revert "memcg: drop kmem.limit_in_bytes"
This reverts commit 21ef9e11205fca43785eecf7d4a99528d4de5701 which is commit 86327e8eb94c52eca4f93cfece2e29d1bf52acbf upstream. It breaks existing runc systems, as the tool always thinks the file should be present. Reported-by: Jeremi Piotrowski <jpiotrowski@linux.microsoft.com> Link: https://lore.kernel.org/r/20230920081101.GA12096@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net Cc: Michal Hocko <mhocko@suse.com> Cc: Shakeel Butt <shakeelb@google.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Roman Gushchin <roman.gushchin@linux.dev> Cc: Muchun Song <muchun.song@linux.dev> Cc: Tejun Heo <tj@kernel.org> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 0a403b241718..67b6d8238b3e 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3841,6 +3841,10 @@ static ssize_t mem_cgroup_write(struct kernfs_open_file *of,
case _MEMSWAP:
ret = mem_cgroup_resize_max(memcg, nr_pages, true);
break;
+ case _KMEM:
+ /* kmem.limit_in_bytes is deprecated. */
+ ret = -EOPNOTSUPP;
+ break;
case _TCP:
ret = memcg_update_tcp_max(memcg, nr_pages);
break;
@@ -5052,6 +5056,12 @@ static struct cftype mem_cgroup_legacy_files[] = {
},
#endif
{
+ .name = "kmem.limit_in_bytes",
+ .private = MEMFILE_PRIVATE(_KMEM, RES_LIMIT),
+ .write = mem_cgroup_write,
+ .read_u64 = mem_cgroup_read_u64,
+ },
+ {
.name = "kmem.usage_in_bytes",
.private = MEMFILE_PRIVATE(_KMEM, RES_USAGE),
.read_u64 = mem_cgroup_read_u64,