[LITMUS^RT] PREEMPT_RT: hrtimer_cancel() system crash

Daniel Bristot de Oliveira danielbristot at gmail.com
Thu Jul 25 00:35:49 CEST 2013


Hi list,

I found why the system crash when calls hrtimer_cancel() while holding
rq->lock. It happens because, on PREEMPT_RT the function hrtimer_cancel
sleep, on vanilla not.

The problem is that the function release_heap_free is called on
litmus_exit_task with rq->lock hold on function __sched_setscheduler.

The release_heap_free calls hrtimer_cancel, it try to sleep with the
preempt off, when the scheduler is called, the system crash.

A workaround is implement hrtimer_cancel as is on the vanilla, with a busy
loop.

This is not good on PREEMPT_RT: a busy loop inside a non preemptive section
can cause a high "release jitter" to the high priority task, and this is
the metric that PREEMPT RT try to minimize.

A workaround is here:
http://www.bristot.eti.br/files/litmus/3_8_13/hrtimer/rq_bug.patch

I will try to fix it in a cleaner way...

-- 
Daniel Bristot de Oliveira
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.litmus-rt.org/pipermail/litmus-dev/attachments/20130724/2942b57d/attachment.html>


More information about the litmus-dev mailing list