On Sat, 2013-06-22 at 03:57 -0400, Peter Hurley wrote:Will this spin for full scheduler value on a reader-owned lock?
+ /* wait_lock will be acquired if write_lock is obtained */^^^^^^^^
+ if (rwsem_try_write_lock(sem->count, true, sem)) {
+ ret = 1;
+ goto out;
+ }
+
+ /*
+ * When there's no owner, we might have preempted between the
Isn't pre-emption disabled?
Peter, on further review, this code is needed. This code guard against
the case of this thread preempting another thread in the middle
of setting the owner field. Disabling preemption does not prevent this
thread from preempting others, even though others cannot preempt
this thread.