cgroups: fix cpu.shares assignment and set memory hierarchy

- Fix obvious refactor mistake in cpu.shares assignment
- For unified memory hierarchy we need to set .use_hierarch=1

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2021-03-14 12:27:46 +01:00
parent 6d0c679e05
commit 9842786453
+5 -1
View File
@@ -47,7 +47,11 @@ static void group_init(char *path, char *nproc, int share)
paste(file, sizeof(file), path, "cpuset.mems");
echo(file, 0, "0");
echo(FINIT_CGPATH "/init/cpu.shares", 0, "%d", share);
paste(file, sizeof(file), path, "cpu.shares");
echo(file, 0, "%d", share);
paste(file, sizeof(file), path, "memory.use_hierarchy");
echo(file, 0, "1");
}
static void append_ctrl(char *ctrl)