On Mon, 2013-06-24 at 16:48 -0400, Peter Hurley wrote: > > Also, I haven't given a lot of thought to if preemption must be disabled > before calling rwsem_can_spin_on_owner(). If so, wouldn't you just drop > rwsem_can_spin_on_owner() (because the conditions tested in the loop are > equivalent)? > Not totally equivalent. If we drop the call to rwsem_can_spin_on_owner, we will spin when readers are holding the lock (owner is null). Right now we only allow writers to spin when other writers are holding the lock by adding the rwsem_can_spin_on_owner check. Letting spinning on readers held lock is tricky as we could have a reader that sleeps and if we don't detect the case. We could spin for too long. Thanks. Tim -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>