Re: [patch 0/6] lightweight robust futexes: -V3

Ingo Molnar
2006-02-17T12:01:43Z

* Paul Jackson <pj@sgi.com> wrote:

> [ ... nice writeup of the robust-futex ABI ... ]

can i put this into Documentation/robust-futex-ABI.txt?

> Other details ...
>
> Nit ...
>
> +If a futex is found to be held at exit time, the kernel sets the highest
> +bit of the futex word:
> +
> + #define FUTEX_OWNER_DIED 0x40000000
>
> Contrary to the comment, that doesn't look like the "highest bit."

ok, i fixed this in the text.

> Confusion ...
>
> +The list is guaranteed to be private and per-thread, so it's lockless.
>
> This statement seems like it is stretching the truth a bit.
> As best as I can tell, the 'head' is private per-thread, but the
> elements on the list are shared by all contending threads, and so
> adding and removing these elements from a given threads list requires
> some sort of contention handling mechanism, which the code provides.

well, from the kernel's perspective, the list _as it exists_ is private
and per-thread, so it can be accessed in a lockless way.

from the userspace perspective you are right, it's only private if the
list entry is manipulated after acquiring the lock.

i fixed up the text to reflect this.

Ingo