Messages in this thread | | | Subject | Re: asterisk hangs with RT priority | From | Peter Zijlstra <> | Date | Wed, 24 Dec 2008 22:32:43 +0100 |
| |
On Thu, 2008-12-25 at 07:37 +1100, Herbert Xu wrote: > On Wed, Dec 24, 2008 at 07:12:25PM +0530, Dhaval Giani wrote: > > > > Hmm. Do you have CONFIG_FAIR_USER_SCHED set on? > > I can't find such a config option, but > > $ grep SCHED .config > CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y > CONFIG_GROUP_SCHED=y > CONFIG_FAIR_GROUP_SCHED=y > CONFIG_RT_GROUP_SCHED=y > CONFIG_USER_SCHED=y > # CONFIG_CGROUP_SCHED is not set
> CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y > CONFIG_SCHED_HRTICK=y
So you have uid-group scheduling and RT-group scheduling enabled (a feature that's experimental for real and has never been enabled by default), looking at the sys_setuid() code, the real uid change is done by switch_uid() and that doesn't have a failable scheduler hook.
The thing is, I suspect the uid you switch to doesn't have a RT runtime quota configured, therefore the RT task that gets placed in it by switch_uid() doesn't get to run.
[ Please read Documentation/scheduler/sched-rt-group.txt when you enable RT group scheduling ]
The correct thing would be for switch_uid() (or set_user) to fail with -EINVAL, much like cpu_cgroup_can_attach() currently does for cgroup grouping.
After that it demonstrates a bug in your test program, which fails to check errors ;-)
| |