[CRIU] [PATCH 4/4] Fill out cgroup properties restoration list

gbellack at google.com gbellack at google.com
Thu Aug 7 15:26:14 PDT 2014


From: Garrison Bellack <gbellack at google.com>

Building on top of the cgroup properties infrastructure patch, this patch will
add all the cgroups properties to the static list of properties we want to restore.

Change-Id: I992c260089dcc2ba169a8ac5b19d73f29c678e7d
Signed-off-by: Garrison Bellack <gbellack at google.com>
---
 cgroup.c | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/cgroup.c b/cgroup.c
index bd72999..8ccefc2 100644
--- a/cgroup.c
+++ b/cgroup.c
@@ -29,11 +29,48 @@
 
 static const char *cpu_props[] = {
 	"cpu.shares",
+	"cpu.cfs_period_us",
+	"cpu.cfs_quota_us",
+	"cpu.rt_period_us",
+	"cpu.rt_runtime_us",
+	"notify_on_release",
 	NULL
 };
 
 static const char *memory_props[] = {
+	/* limit_in_bytes and memsw.limit_in_bytes must be set in this order */
 	"memory.limit_in_bytes",
+	"memory.memsw.limit_in_bytes",
+	"memory.use_hierarchy",
+	"notify_on_release",
+	NULL
+};
+
+static const char *cpuset_props[] = {
+	/*
+	 * cpuset.cpus and cpuset.mems must be set before the process moves
+	 * into its cgroup and hence can't be done here
+	 */
+	"cpuset.memory_migrate",
+	"cpuset.cpu_exclusive",
+	"cpuset.mem_exclusive",
+	"cpuset.mem_hardwall",
+	"cpuset.memory_spread_page",
+	"cpuset.memory_spread_slab",
+	"cpuset.sched_load_balance",
+	"cpuset.sched_relax_domain_level",
+	"notify_on_release",
+	NULL
+};
+
+static const char *blkio_props[] = {
+	"blkio.weight",
+	"notify_on_release",
+	NULL
+};
+
+static const char *freezer_props[] = {
+	"notify_on_release",
 	NULL
 };
 
@@ -329,6 +366,12 @@ static const char **get_known_properties(char *controller)
 		prop_arr = cpu_props;
 	else if (!strcmp(controller, "memory"))
 		prop_arr = memory_props;
+	else if (!strcmp(controller, "cpuset"))
+		prop_arr = cpuset_props;
+	else if (!strcmp(controller, "blkio"))
+		prop_arr = blkio_props;
+	else if (!strcmp(controller, "freezer"))
+		prop_arr = freezer_props;
 
 	return prop_arr;
 }
-- 
2.0.0.526.g5318336



More information about the CRIU mailing list