[Devel] [PATCH RH9 02/23] mm/memcg: enable memory.high for cgroup v1.

Vasily Averin vvs at virtuozzo.com
Sun Sep 26 13:04:56 MSK 2021


This adds memory.high file in cgroup v1. Semantics is the
same as for cgroup v2.

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

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 0ad4b3906279..88e156fdb00d 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4918,6 +4918,9 @@ static ssize_t memcg_write_event_control(struct kernfs_open_file *of,
 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 int memory_high_show(struct seq_file *m, void *v);
+static ssize_t memory_high_write(struct kernfs_open_file *of,
+				 char *buf, size_t nbytes, loff_t off);
 
 static struct cftype mem_cgroup_legacy_files[] = {
 	{
@@ -4955,6 +4958,12 @@ static struct cftype mem_cgroup_legacy_files[] = {
 		.write = memory_low_write,
 		.seq_show = memory_low_show,
 	},
+	{
+		.name = "high",
+		.flags = CFTYPE_NOT_ON_ROOT,
+		.seq_show = memory_high_show,
+		.write = memory_high_write,
+	},
 	{
 		.name = "stat",
 		.seq_show = memcg_stat_show,
-- 
2.25.1



More information about the Devel mailing list