[patch] spin-nicer-2.6.11-rc1-A0

Paul Mackerras paulus at samba.org
Sun Jan 16 09:54:22 EST 2005


Ingo Molnar writes:

> +BUILD_LOCK_OPS(spin, spinlock_t, spin_is_locked);
> +BUILD_LOCK_OPS(read, rwlock_t, rwlock_is_locked);

I don't think this is right - this means that a cpu trying to acquire
a read lock will spin while any other cpu has a read lock.  We need to
invent and use a rwlock_is_write_locked() here.  PPC64 and parisc have
an is_write_locked() already, and it shouldn't be too hard to do one
for the other architectures (i386 wants (signed int)rw->lock <= 0,
most other arches seem to need (signed int)rw->lock < 0).

> +BUILD_LOCK_OPS(write, rwlock_t, spin_is_locked);

This one should be rwlock_is_locked, surely?  Otherwise the compiler
will grizzle about us calling spin_is_locked with a rwlock_t *.

Regards,
Paul.



More information about the Linuxppc64-dev mailing list