Re: [PATCH] sched, autogroup: Fix failure when writing to cpu.rt_runtime_us

2015-02-09 Thread Zefan Li
> Subject: sched, autogroup: Fix failure to set cpu.rt_runtime_us > From: Peter Zijlstra > Date: Mon Feb 9 11:53:18 CET 2015 > > Because task_group() uses a cache of autogroup_task_group(), whoes > output depends on sched_class, switching classes can generate > problems. > > In particular, when

Re: [PATCH] sched, autogroup: Fix failure when writing to cpu.rt_runtime_us

2015-02-09 Thread Peter Zijlstra
On Mon, Feb 09, 2015 at 12:22:37PM +0100, Peter Zijlstra wrote: > Indeed, setting runtime=0 for the root group is a very bad thing > regardless of this patch. It would disallow the kernel from creating RT > threads, which it needs for 'correct' operation in a number of cases. > > But lets make tha

Re: [PATCH] sched, autogroup: Fix failure when writing to cpu.rt_runtime_us

2015-02-09 Thread Peter Zijlstra
On Sat, Feb 07, 2015 at 03:02:11PM +0800, Zefan Li wrote: > Before 8323f26ce342 "sched: Fix race in task_group()", task_group() of > those RT tasks always return root_task_group, but the escape can't happen. Ah, yes, I'm an idiot. I'm not sure what I was thinking, but I seemed to have confused mys

Re: [PATCH] sched, autogroup: Fix failure when writing to cpu.rt_runtime_us

2015-02-06 Thread Zefan Li
>> See this commit: >> >> commit f44937718ce3b8360f72f6c68c9481712517a867 >> Author: Mike Galbraith >> Date: Thu Jan 13 04:54:50 2011 +0100 >> >> sched, autogroup: Fix CONFIG_RT_GROUP_SCHED sched_setscheduler() failure >> ... >> + /* >> +* Autogroup RT tasks are redirected to t

Re: [PATCH] sched, autogroup: Fix failure when writing to cpu.rt_runtime_us

2015-02-06 Thread Peter Zijlstra
On Fri, Feb 06, 2015 at 09:30:51AM +0800, Zefan Li wrote: > After running the test program, we have: > > root >| > autogroup <-- the RT test program is now here > > root.rt_runtime = 95 > autogroup.rt_runtime = 0 > > Now if you try to change the rt_runtime of the root cgroup, it re

Re: [PATCH] sched, autogroup: Fix failure when writing to cpu.rt_runtime_us

2015-02-05 Thread Zefan Li
On 2015/2/5 22:25, Peter Zijlstra wrote: > On Thu, Feb 05, 2015 at 04:33:24PM +0800, Zefan Li wrote: >> This is how to reproduce the bug: >> >> int main() { >> struct sched_param param = {.sched_priority=1}; >> >> if (fork() > 0) >> exit(0); >> >> setsid(); >> >> if (sched_s

Re: [PATCH] sched, autogroup: Fix failure when writing to cpu.rt_runtime_us

2015-02-05 Thread Peter Zijlstra
On Thu, Feb 05, 2015 at 04:33:24PM +0800, Zefan Li wrote: > This is how to reproduce the bug: > > int main() { > struct sched_param param = {.sched_priority=1}; > > if (fork() > 0) > exit(0); > > setsid(); > > if (sched_setscheduler(0, SCHED_RR, ¶m) < 0){ > perro