Re: [PATCH] generalized spin_lock_bit

Robert Love (rml@tech9.net)
20 Jul 2002 15:46:14 -0700


On Sat, 2002-07-20 at 15:27, David S. Miller wrote:
> From: Robert Love <rml@tech9.net>
> Date: 20 Jul 2002 13:21:51 -0700
>
> Thanks to Christoph Hellwig for prodding to make it per-architecture,
> Ben LaHaise for the loop optimization, and William Irwin for the
> original bit locking.
>
> Just note that the implementation of these bit spinlocks will be
> extremely expensive on some platforms that lack "compare and swap"
> type instructions (or something similar like "load locked, store
> conditional" as per mips/alpha).

That is what they do use, but the code is pushed into the architecture
headers so you can do something else if you choose.

I originally just had a single generic version, but people representing
the greater good of SPARC and PA-RISC argued otherwise. It should be
simple enough to just paste the generic implementations into your
asm/spinlock.h if you do not want to do any hand-tuning.

Robert Love

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