Re: spin_unlock optimization(i386)

Ingo Molnar (mingo@chiara.csoma.elte.hu)
Fri, 26 Nov 1999 12:29:11 +0100 (CET)


On Fri, 26 Nov 1999, Helge Hafting wrote:

> Don't be confused when this too eventually breaks when tested.
> The counters will wrap, i slightly before j, and that may trigger the
> BUG().

yep, right.

> For a safe test, change the first loop to:
>
> if (i == 0x7FFFFFFF) {
> j = 0;
> i = 0;
> }

yep, subtle, and the order of those two stores is not irrelevant either.

Ingo

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/