[Devel] [PATCH RHEL COMMIT] mm/memcg: enable memory.low for cgroup v1

Konstantin Khorenko khorenko at virtuozzo.com
Tue Sep 28 14:05:09 MSK 2021


The commit is pushed to "branch-rh9-5.14.vz9.1.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after ark-5.14
------>
commit 6d864ffb087505e5a52794719f7d543bd13344f8
Author: Vasily Averin <vvs at virtuozzo.com>
Date:   Tue Sep 28 14:05:03 2021 +0300

    mm/memcg: enable memory.low for cgroup v1
    
    This adds memory.low for cgroup v1. Semantics the same as
    for cgroup v2.
    
    Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
    
    (cherry picked from commit 9ab48918d4587dc614595055e66e2e17af5c4a44)
    VvS: rebase to rh9
    https://jira.sw.ru/browse/PSBM-133990
    Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
 mm/memcontrol.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 6d882c660c21..b64b4b2bdee0 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5027,6 +5027,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",
@@ -5057,6 +5061,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,


More information about the Devel mailing list