This patch (made against linux-2.4.4-pre2) takes Anton Blanchard's suggestions and abstracts out the rwsem implementation somewhat. This makes the following general files: include/linux/rwsem.h - general RW semaphore wrapper include/linux/rwsem-spinlock.h - rwsem inlines implemented in C include/asm-xxx/rwsem.h - arch specific rwsem details lib/rwsem.c - contention handlers for rwsems The asm/rwsem.h file is responsible for specifying whether the general default implementation should be used, or supplying an alternative optimised implementation if not. For the i386 arch, I've supplied the following: include/asm-i386/rwsem.h - i386 specific rwsem details include/asm-i386/rwsem-xadd.h - i386 XADD optimised rwsems include/asm-i386/rwsem-spin.h - i386 optimised spinlocked rwsems arch/i386/lib/rwsem.S - i386 call wrapper stubs I haven't changed any of the other arch's, but until their semaphore.h's refer to linux/rwsem.h, they'll continue to use whatever method they currently happen to use. Note that the contention handling functions have been renamed to prevent name clashes with the old contention functions. David