Re: [PATCH] locking/rwsem: Fix lock optimistic spinning when owner is not running

2015-03-09 Thread Jason Low
On Sat, 2015-03-07 at 13:17 -0500, Sasha Levin wrote: > On 03/07/2015 02:45 AM, Jason Low wrote: > > Fixes tip commit b3fd4f03ca0b (locking/rwsem: Avoid deceiving lock > > spinners). > > > > Ming reported soft lockups occurring when running xfstest due to > > commit b3fd4f03ca0b. > > > > When

Re: [PATCH] locking/rwsem: Fix lock optimistic spinning when owner is not running

2015-03-09 Thread Jason Low
On Sat, 2015-03-07 at 10:21 +0100, Peter Zijlstra wrote: > On Fri, Mar 06, 2015 at 11:45:31PM -0800, Jason Low wrote: > > static noinline > > bool rwsem_spin_on_owner(struct rw_semaphore *sem, struct task_struct > > *owner) > > { > > long count; > > > > rcu_read_lock(); > > + while

Re: [PATCH] locking/rwsem: Fix lock optimistic spinning when owner is not running

2015-03-09 Thread Jason Low
On Sat, 2015-03-07 at 10:21 +0100, Peter Zijlstra wrote: On Fri, Mar 06, 2015 at 11:45:31PM -0800, Jason Low wrote: static noinline bool rwsem_spin_on_owner(struct rw_semaphore *sem, struct task_struct *owner) { long count; rcu_read_lock(); + while (sem-owner ==

Re: [PATCH] locking/rwsem: Fix lock optimistic spinning when owner is not running

2015-03-09 Thread Jason Low
On Sat, 2015-03-07 at 13:17 -0500, Sasha Levin wrote: On 03/07/2015 02:45 AM, Jason Low wrote: Fixes tip commit b3fd4f03ca0b (locking/rwsem: Avoid deceiving lock spinners). Ming reported soft lockups occurring when running xfstest due to commit b3fd4f03ca0b. When doing optimistic

Re: [PATCH] locking/rwsem: Fix lock optimistic spinning when owner is not running

2015-03-07 Thread Sasha Levin
On 03/07/2015 02:45 AM, Jason Low wrote: > Fixes tip commit b3fd4f03ca0b (locking/rwsem: Avoid deceiving lock spinners). > > Ming reported soft lockups occurring when running xfstest due to > commit b3fd4f03ca0b. > > When doing optimistic spinning in rwsem, threads should stop spinning when >

Re: [PATCH] locking/rwsem: Fix lock optimistic spinning when owner is not running

2015-03-07 Thread Peter Zijlstra
On Fri, Mar 06, 2015 at 11:45:31PM -0800, Jason Low wrote: > static noinline > bool rwsem_spin_on_owner(struct rw_semaphore *sem, struct task_struct *owner) > { > long count; > > rcu_read_lock(); > + while (sem->owner == owner) { > + /* > + * Ensure we

Re: [PATCH] locking/rwsem: Fix lock optimistic spinning when owner is not running

2015-03-07 Thread Sasha Levin
On 03/07/2015 02:45 AM, Jason Low wrote: Fixes tip commit b3fd4f03ca0b (locking/rwsem: Avoid deceiving lock spinners). Ming reported soft lockups occurring when running xfstest due to commit b3fd4f03ca0b. When doing optimistic spinning in rwsem, threads should stop spinning when the lock

Re: [PATCH] locking/rwsem: Fix lock optimistic spinning when owner is not running

2015-03-07 Thread Peter Zijlstra
On Fri, Mar 06, 2015 at 11:45:31PM -0800, Jason Low wrote: static noinline bool rwsem_spin_on_owner(struct rw_semaphore *sem, struct task_struct *owner) { long count; rcu_read_lock(); + while (sem-owner == owner) { + /* + * Ensure we emit the

[PATCH] locking/rwsem: Fix lock optimistic spinning when owner is not running

2015-03-06 Thread Jason Low
Fixes tip commit b3fd4f03ca0b (locking/rwsem: Avoid deceiving lock spinners). Ming reported soft lockups occurring when running xfstest due to commit b3fd4f03ca0b. When doing optimistic spinning in rwsem, threads should stop spinning when the lock owner is not running. While a thread is spinning

[PATCH] locking/rwsem: Fix lock optimistic spinning when owner is not running

2015-03-06 Thread Jason Low
Fixes tip commit b3fd4f03ca0b (locking/rwsem: Avoid deceiving lock spinners). Ming reported soft lockups occurring when running xfstest due to commit b3fd4f03ca0b. When doing optimistic spinning in rwsem, threads should stop spinning when the lock owner is not running. While a thread is spinning