Re: [patch 4/4] ipc: sem optimise simple operations

Manfred Spraul
2009-08-12T18:42:19Z

On 08/12/2009 06:07 AM, Nick Piggin wrote:
> A semaphore set with 250 will use 2K before, and 10K afterward. I
> don't know that it is a huge amount really, given that they also
> have to presumably be *protecting* stuff.
>
>
The allocation uses vmalloc for larger allocations, thus 10k should not
be an issue.
> We can convert them to hlists (I was going to send a patch to do
> everything in hlists, but hlists are missing some _rcu variants...
> maybe I should just convert the pending lists to start with).
>
>
Is it possible to use list_add and list_add_tail instead?
Add the "waiting for zero" to the beginning and "waiting for nonzero" to
the end.

Basically, the same approach for "simple" and "complex" operations:
- if all operations are simple operations, then all operations affect
only individual semaphores
--> use per semaphore lists
- if there is one complex operation, then the global, per
semaphore-array lists are used.

--
Manfred