This adds memory.low for cgroup v1. Semantics the same as
for cgroup v2.

Signed-off-by: Andrey Ryabinin <aryabi...@virtuozzo.com>
(cherry picked from commit 9ab48918d4587dc614595055e66e2e17af5c4a44)
VvS: rebase to rh9
https://jira.sw.ru/browse/PSBM-133990
Signed-off-by: Vasily Averin <v...@virtuozzo.com>
---
 mm/memcontrol.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 702a81dfe72d..0ad4b3906279 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4915,6 +4915,10 @@ static ssize_t memcg_write_event_control(struct 
kernfs_open_file *of,
        return ret;
 }
 
+static ssize_t memory_low_write(struct kernfs_open_file *of,
+                               char *buf, size_t nbytes, loff_t off);
+static int memory_low_show(struct seq_file *m, void *v);
+
 static struct cftype mem_cgroup_legacy_files[] = {
        {
                .name = "usage_in_bytes",
@@ -4945,6 +4949,12 @@ static struct cftype mem_cgroup_legacy_files[] = {
                .write = mem_cgroup_reset,
                .read_u64 = mem_cgroup_read_u64,
        },
+       {
+               .name = "low",
+               .flags = CFTYPE_NOT_ON_ROOT,
+               .write = memory_low_write,
+               .seq_show = memory_low_show,
+       },
        {
                .name = "stat",
                .seq_show = memcg_stat_show,
-- 
2.25.1

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to