[Devel] [PATCH rh7 1/2] fairsched: drop host node

Vladimir Davydov vdavydov at parallels.com
Fri May 8 07:37:45 PDT 2015


The fairsched host node, i.e. cpu/cpuset cgroup /0, conflicts with
systemd: the latter moves all processes out of it and even tries to
delete it. To make it work as expected we should create /0 from the
userspace via systemd.

Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 kernel/fairsched.c |   20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

diff --git a/kernel/fairsched.c b/kernel/fairsched.c
index 978fd126bdb4..0d0fa5c0a597 100644
--- a/kernel/fairsched.c
+++ b/kernel/fairsched.c
@@ -26,7 +26,6 @@ struct fairsched_node {
 };
 
 static struct fairsched_node root_node = {NULL, NULL};
-static struct fairsched_node host_node = {NULL, NULL};
 
 /* fairsched use node id = INT_MAX for ve0 tasks */
 #define FAIRSCHED_HOST_NODE 2147483647
@@ -91,7 +90,7 @@ static int fairsched_move(struct fairsched_node *node, struct task_struct *tsk)
 
 	ret = cgroup_kernel_attach(node->cpuset, tsk);
 	if (ret) {
-		err = cgroup_kernel_attach(host_node.cpu, tsk);
+		err = cgroup_kernel_attach(root_node.cpu, tsk);
 		if (err)
 			printk(KERN_ERR "Cleanup error, fairsched id=, err=%d\n", err);
 	}
@@ -379,7 +378,7 @@ void fairsched_drop_node(int id, int leave)
 	int err;
 
 	if (leave) {
-		err = fairsched_move(&host_node, current);
+		err = fairsched_move(&root_node, current);
 		if (err)
 			printk(KERN_ERR "Can't leave fairsched node %d "
 					"err=%d\n", id, err);
@@ -769,7 +768,6 @@ extern int sysctl_sched_rt_runtime;
 int __init fairsched_init(void)
 {
 	struct vfsmount *cpu_mnt, *cpuset_mnt;
-	int ret;
 	struct cgroup_sb_opts cpu_opts = {
 		.name		= vz_compat ? "fairsched" : NULL,
 		.subsys_mask	=
@@ -794,20 +792,6 @@ int __init fairsched_init(void)
 	}
 	root_node.cpuset = cgroup_get_root(cpuset_mnt);
 
-	ret = fairsched_create(&host_node, 0);
-	if (ret)
-		return ret;
-
-	ret = sched_cgroup_set_rt_runtime(host_node.cpu,
-					  3 * sysctl_sched_rt_runtime / 4);
-	if (ret)
-		printk(KERN_WARNING
-		       "Can't set rt runtime for fairsched host: %d\n", ret);
-
-	ret = fairsched_move(&host_node, init_pid_ns.child_reaper);
-	if (ret)
-		return ret;
-
 #ifdef CONFIG_PROC_FS
 	proc_create("fairsched", S_ISVTX, NULL,	&proc_fairsched_operations);
 	proc_create("fairsched2", S_ISVTX, NULL, &proc_fairsched_operations);
-- 
1.7.10.4




More information about the Devel mailing list