Sending some form of notifaction when sched_fifo throttling kicksin...

From: torbenh
Date: Thu Dec 23 2010 - 06:39:37 EST



hi...

when the rt_runtime budget is exceeded, the kernel silently stops
scheduling RT tasks. there is no way to distinguish this from
a task taking very long to complete.

it would be very nice, if the kernel would send some form of notifaction
when it starts throttling things.

recording the timestamp of the last occurence of throttling
in a /proc file would be sufficient, if there were no cgroups.

would it be possible to add a readonly property to the cpu subsystem ?
there is already a printk_once, but thats pretty useless :)


from -rt kernel kernel/sched_rt.c:

----------------------------------------------------------------------------------
static int sched_rt_runtime_exceeded(struct rt_rq *rt_rq)
{
u64 runtime = sched_rt_runtime(rt_rq);

if (rt_rq->rt_throttled)
return rt_rq_throttled(rt_rq);

if (sched_rt_runtime(rt_rq) >= sched_rt_period(rt_rq))
return 0;

balance_runtime(rt_rq);
runtime = sched_rt_runtime(rt_rq);
if (runtime == RUNTIME_INF)
return 0;

if (rt_rq->rt_time > runtime) {
rt_rq->rt_throttled = 1;
printk_once(KERN_WARNING "sched: RT throttling activated\n");
+ // send some form of notification.
if (rt_rq_throttled(rt_rq)) {
sched_rt_rq_dequeue(rt_rq);
return 1;
}
}

return 0;
}
-----------------------------------------------------------------------------------
--
torben Hohn
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/