Re: [PATCH v0] add nano semaphore in kernel

From: Arnd Bergmann
Date: Wed Dec 29 2010 - 06:49:34 EST


On Tuesday 28 December 2010 16:51:30 Daniel Walker wrote:
> We for sure don't want new semaphores, or new semaphore usage in the
> kernel ..

Yes. I once even tried unifying the semaphore and rwsem implementation,
but gave up on that for a number of reasons.

> It should also be noted that the rtmutex (kernel/rtmutex.c) already has
> this capability. Although I don't think you can use an rtmutex from
> inside the kernel.

I wasn't aware we had already grown another one ;-)

AFAICT, you can only use it inside of the kernel, but it's very
specific and I wouldn't recommend using it unless a regular mutex
cannot be used for some reason. The only user besides the futex
code seems to be the i2c layer at this moment.

> If you really want this you should look into the rtmutex, and the
> regular mutex API's .

If Hillf relies on counting semaphores, that won't work, but very
few such users exist in code outside of textbooks.

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