Re: [PATCH] cpuset semaphore depth check optimize

From: Ingo Molnar
Date: Tue Sep 13 2005 - 02:04:34 EST



* Linus Torvalds <torvalds@xxxxxxxx> 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
-
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/