All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: Relax a restriction in sched_rt_can_attach()
@ 2015-05-04  0:54 ` Zefan Li
  0 siblings, 0 replies; 43+ messages in thread
From: Zefan Li @ 2015-05-04  0:54 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Peter Zijlstra, Tejun Heo, LKML, Cgroups

It's allowed to promote a task from normal to realtime after it has been
attached to a non-root cgroup, but it will fail if the attaching happens
after it has become realtime. I don't see how this restriction is useful.

We are moving toward unified hierarchy where all the cgroup controllers
are bound together, so it would make cgroups easier to use if we have less
restrictions on attaching tasks between cgroups.

Signed-off-by: Zefan Li <lizefan@huawei.com>
---
 kernel/sched/core.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index fe22f75..55c21f7 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -7800,6 +7800,11 @@ static int sched_rt_global_constraints(void)
 
 	return ret;
 }
+
+static int sched_rt_can_attach(struct task_group *tg, struct task_struct *tsk)
+{
+	return 1;
+}
 #endif /* CONFIG_RT_GROUP_SCHED */
 
 static int sched_dl_global_validate(void)
@@ -8002,16 +8007,9 @@ static int cpu_cgroup_can_attach(struct cgroup_subsys_state *css,
 {
 	struct task_struct *task;
 
-	cgroup_taskset_for_each(task, tset) {
-#ifdef CONFIG_RT_GROUP_SCHED
+	cgroup_taskset_for_each(task, tset)
 		if (!sched_rt_can_attach(css_tg(css), task))
 			return -EINVAL;
-#else
-		/* We don't support RT-tasks being in separate groups */
-		if (task->sched_class != &fair_sched_class)
-			return -EINVAL;
-#endif
-	}
 	return 0;
 }
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2015-05-06  9:13 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-04  0:54 [PATCH] sched: Relax a restriction in sched_rt_can_attach() Zefan Li
2015-05-04  0:54 ` Zefan Li
2015-05-04  3:13 ` Mike Galbraith
2015-05-04  3:13   ` Mike Galbraith
2015-05-04  4:39   ` Zefan Li
2015-05-04  4:39     ` Zefan Li
2015-05-04  5:10     ` Mike Galbraith
2015-05-04  5:10       ` Mike Galbraith
2015-05-04  5:39       ` Mike Galbraith
2015-05-04  5:39         ` Mike Galbraith
2015-05-04  9:11         ` Zefan Li
2015-05-04  9:11           ` Zefan Li
2015-05-04 12:08           ` Mike Galbraith
2015-05-04 12:08             ` Mike Galbraith
2015-05-04 12:37           ` Peter Zijlstra
2015-05-04 12:37             ` Peter Zijlstra
2015-05-04 14:09             ` Mike Galbraith
2015-05-05  3:46               ` Zefan Li
2015-05-05  3:46                 ` Zefan Li
2015-05-05  6:02                 ` Mike Galbraith
2015-05-05  6:02                   ` Mike Galbraith
2015-05-05  3:54             ` Zefan Li
2015-05-05  3:54               ` Zefan Li
2015-05-05 14:10               ` Peter Zijlstra
2015-05-05 14:18                 ` Tejun Heo
2015-05-05 15:19                   ` Peter Zijlstra
2015-05-05 16:31                     ` Tejun Heo
2015-05-05 19:00                       ` Peter Zijlstra
2015-05-05 19:06                         ` Tejun Heo
2015-05-05 19:06                           ` Tejun Heo
2015-05-06  8:49                           ` Peter Zijlstra
2015-05-06  8:49                             ` Peter Zijlstra
2015-05-05 14:41             ` Tejun Heo
2015-05-05 15:11               ` Peter Zijlstra
2015-05-05 16:13                 ` Tejun Heo
2015-05-05 16:50                   ` Peter Zijlstra
2015-05-05 18:29                     ` Thomas Gleixner
2015-05-05 19:00                       ` Tejun Heo
2015-05-05 19:00                         ` Tejun Heo
2015-05-06  9:12                         ` Thomas Gleixner
2015-05-05 18:31                     ` Tejun Heo
2015-05-05 14:09         ` Tejun Heo
2015-05-05 14:09           ` Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.