Re: [PATCH] generalized spin_lock_bit

David S. Miller (davem@redhat.com)
Sat, 20 Jul 2002 15:27:03 -0700 (PDT)


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).

Why not just use the existing bitops implementation? The code is
going to be mostly identical, ala:

while (test_and_set_bit(ptr, nr)) {
while (test_bit(ptr, nr))
barrier();
}

This makes less work for architectures to support this thing.
-
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/