Re: Query on Linux process sheduling

From: Jonathan Corbet
Date: Sat Mar 24 2012 - 10:40:31 EST

On Sat, 24 Mar 2012 17:25:41 +0530
"B.Vinai Kumar" <vinaibangala2001@xxxxxxxxx> wrote:

> I have embedded box running linux kernel and running 6 Real

Wow...ancient history :)

> time task threads (With SCHED_RR as scheduling policy).
> Together all the 6 threads running is consuming around 85% of CPU,
> which is expected.
> All the threads have a 10ms of cycle.
> The issue is for every second I have observed that for 50ms these Real
> time task threads are not scheduling at all. During this 50ms
> the process swapper/idle task is being scheduled(pid 0).
> Is this the behaviour is due to these values?
> # cat /proc/sys/kernel/sched_rt_period_us
> 1000000
> # cat /proc/sys/kernel/sched_rt_runtime_us
> 950000

Indeed, you're on the right track. The scheduler preserves a little bit
of time for non-RT tasks to give you a chance to recover if something goes
totally nuts.

> What changes can be done to the kernel so that the Real time task
> threads get scheduled in that 50ms interval too?

Setting those two knobs to the same value should do the trick, but it does
increase the risk of losing control of the system. See
Documentation/scheduler/sched-rt-group.txt for more information on how
these knobs work.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at