Re: report a bug about sched_rt

sen wang
2009-07-24T13:12:20Z

Linux is used in many fieldes. SCHED_OTHER tasks is important to
embedded system.

if there is a running state task（a realtime task）, how can we shcedule
the idle task up?
It is ridiculous！

since the throttle has a bug, why not fix it?

we just modify the codes of checking conditions of picking rt taskes!

static struct task_struct *pick_next_task_rt(struct rq *rq)
{
...

if (rt_rq_throttled(rt_rq)&& rq->cfs.nr_running)
return NULL;

...
}

2009/7/24 Peter Zijlstra <peterz@infradead.org>:
> On Fri, 2009-07-24 at 18:57 +0800, sen wang wrote:
>> I find something is wrong about sched_rt.
>>
>>  when I am debugging my system with rt_bandwidth_enabled, there is a
>> running realtime FIFO task in the sched_rt running queue and
>>  the fair running queue is empty.  I found the idle task will be
>> scheduled up when the running task still lie in the  sched_rt running
>> queue!
>>
>> this will happen when rt runqueue passed it's rt_bandwidth_enabled
>> runtime,then the scheduler choose the idle task instead of realtime
>> FIFO task.
>>
>> the reason lie in: when scheduler try to pick up a realtime FIFO task,
>> it will check if rt_throttled is enabled,
>> if so, it'll return and try fair queue but it is empty, then it come
>> to the sched_idle class.
>>
>> I don't think it reasonable, we should give the realtime FIFO task the
>> chance, even when rt runqueue passed it's runtime.
>> because it is cpu's free time.
>>
>> To fix it ,and keep rt_bandwidth works as before, I think
>> pick_next_task_rt() is the best space,
>
> RT is about determinism, sometimes having some extra time dependent on
> the runnability of SCHED_OTHER tasks is utterly useless.
>
> If you don't like the throttle, disable it.
>
>
>