Re: [PATCH 5/5] ipc/sem.c: alternatives to preempt_disable()

From: Peter Zijlstra
Date: Tue Jan 24 2012 - 09:51:50 EST


On Sat, 2011-10-15 at 15:22 +0200, Manfred Spraul wrote:
> ipc/sem.c uses a custom wakeup scheme that relies on preempt_disable().
> On -RT, this causes increased latencies and debug warnings.
>
> The patch adds two additional schemes:
> - one built around a completion - could be better for -RT kernels
> - one built around a spinlock - unfortunately it's broken
> - and the current one
>
> Mike, Peter: Would the completion work on -rt?
>
> My preferred solution would be the spinlock implementation:
> RT would use premptible spinlocks, mainline normal spinlocks.
> Thus both get the optimal implementation without any special code in
> ipc/sem.c.
> Unfortunately, I don't see how it could be fixed.

Sorry, I was convinced I replied to this, but I cannot actually find
anything in my send folder or elsewhere. Thanks for poking Andrew.

Yes I think it should work, and I'm afraid I have to agree with not
being able to make the spinlock thing work properly. Even if you were to
use arch_spin_* primitives you can still run into the 256 limit --
although not from the preempt_count in that case. Nor would arch_spin_
do what we need on -rt.


--
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/