Re: [PATCH] cpuset semaphore depth check optimize

Ingo Molnar
2005-09-13T07:04:15Z

* Linus Torvalds <torvalds@osdl.org> wrote:

> Personally, the thing that makes me think the patch is ugly is the
> fact that the different parts of the nested semaphore are all
> separate. I'd prefer to see a
>
> struct nested_semaphore {
> struct semaphore sem;
> struct task_struct *owner;
> unsigned int count;
> };
>
> and then operate on _that_ level instead.

btw., this is how the -rt tree implements (read-)nesting for rwsems and
rwlocks. The more sharing and embedding of types and primitives, the
more compact the whole code becomes, and the easier it is to change
fundamental properties.

Ingo