Re: [patch] Real-Time Preemption, -RT-2.6.11-rc3-V0.7.38-01

Kevin Hilman
2005-02-04T15:19:52Z

What is the proper way to setup a real counting semaphore under the
-RT kernel?

I've noticed that just using a struct semaphore, normal counting
semaphore usage[*] can trigger the "lock recursion deadlock" in
kernel/rt.c since 'struct semaphore' now uses an rt_mutex.

What I've done for now is to use sema_init_nocheck() to disable the
checking in the case of a counting semaphore, but I remember seeing
discussion in an earlier thread about creating a separate counting
semaphore type. Is this still planned?

Kevin
http://hilman.org/kevin/

[*] For example, an open semaphore being down'ed and thus acquired and
the same thread doing a down() again before another thread has a
chance to up() the semaphore.

Ingo Molnar <mingo@elte.hu> writes:

> i have released the -V0.7.38-01 Real-Time Preemption patch, which can be
> downloaded from the usual place:
>
> http://redhat.com/~mingo/realtime-preempt/
>
> Changes since -37-03:
>
> - merged to 2.6.11-rc3
>
> - deadlock-tracer fix from Eugeny S. Mints
>
> - converted an oprofile spinlock to raw, which should fix the bug
> reported by Peter Zijlstra.
>
> to create a -V0.7.38-01 tree from scratch, the patching order is:
>
> http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.10.tar.bz2
> http://kernel.org/pub/linux/kernel/v2.6/testing/patch-2.6.11-rc3.bz2
> http://redhat.com/~mingo/realtime-preempt/realtime-preempt-2.6.11-rc3-V0.7.38-01