Here's the RW semaphore patch attempt #4. This fixes the bugs that Andrew Morton's test cases showed up. It simplifies the __wake_up_ctx_common() function and adds an iterative clause to the end of rwsem_wake(). David