Re: SMP syncronization on AMD processors (broken?)

From: Linus Torvalds
Date: Thu Oct 06 2005 - 10:47:54 EST




On Thu, 6 Oct 2005, Andrey Savochkin wrote:
>
> I start to wonder about existing mainstream code, presumably bug-free, that
> uses spinlocks without any problematic restart.

Actually, a number of cases where we found things to be a problem have
been converted.

It _is_ a real-life issue, although with "normal" code it only happens in
extreme machines (NUMA with tons of nodes). It's fairly fundamental in
NUMA, and in many ways you do absolutely _not_ want fairness, because it's
much better to take the lock locally a hundred times (almost free) than it
is to bounce it back-and-forth between two nodes a hundred times (very
expensive).

Fairness is often very expensive indeed.

But places where unfairness can be a problem have been converted to things
like RCU, which allows concurrent operations more gracefully.

And sometimes the answer is just "don't do that then".

Linus
-
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/