Re: [PATCH v5 3/3] locking/qrwlock: Don't contend with readers when setting _QW_WAITING

2015-06-26 Thread Will Deacon
On Thu, Jun 25, 2015 at 09:33:36PM +0100, Waiman Long wrote: > On 06/25/2015 02:35 PM, Peter Zijlstra wrote: > > On Fri, Jun 19, 2015 at 11:50:02AM -0400, Waiman Long wrote: > >> The current cmpxchg() loop in setting the _QW_WAITING flag for writers > >> in queue_write_lock_slowpath() will contend

Re: [PATCH v5 3/3] locking/qrwlock: Don't contend with readers when setting _QW_WAITING

2015-06-25 Thread Waiman Long
On 06/25/2015 02:35 PM, Peter Zijlstra wrote: On Fri, Jun 19, 2015 at 11:50:02AM -0400, Waiman Long wrote: The current cmpxchg() loop in setting the _QW_WAITING flag for writers in queue_write_lock_slowpath() will contend with incoming readers causing possibly extra cmpxchg() operations that are

Re: [PATCH v5 3/3] locking/qrwlock: Don't contend with readers when setting _QW_WAITING

2015-06-25 Thread Peter Zijlstra
On Fri, Jun 19, 2015 at 11:50:02AM -0400, Waiman Long wrote: > The current cmpxchg() loop in setting the _QW_WAITING flag for writers > in queue_write_lock_slowpath() will contend with incoming readers > causing possibly extra cmpxchg() operations that are wasteful. This > patch changes the code to

Re: [PATCH v5 3/3] locking/qrwlock: Don't contend with readers when setting _QW_WAITING

2015-06-23 Thread Will Deacon
On Tue, Jun 23, 2015 at 03:57:48AM +0100, Waiman Long wrote: > On 06/22/2015 12:21 PM, Will Deacon wrote: > > On Fri, Jun 19, 2015 at 04:50:02PM +0100, Waiman Long wrote: > >> The current cmpxchg() loop in setting the _QW_WAITING flag for writers > >> in queue_write_lock_slowpath() will contend wit

Re: [PATCH v5 3/3] locking/qrwlock: Don't contend with readers when setting _QW_WAITING

2015-06-22 Thread Waiman Long
On 06/22/2015 12:21 PM, Will Deacon wrote: Hi Waiman, On Fri, Jun 19, 2015 at 04:50:02PM +0100, Waiman Long wrote: The current cmpxchg() loop in setting the _QW_WAITING flag for writers in queue_write_lock_slowpath() will contend with incoming readers causing possibly extra cmpxchg() operations

Re: [PATCH v5 3/3] locking/qrwlock: Don't contend with readers when setting _QW_WAITING

2015-06-22 Thread Will Deacon
Hi Waiman, On Fri, Jun 19, 2015 at 04:50:02PM +0100, Waiman Long wrote: > The current cmpxchg() loop in setting the _QW_WAITING flag for writers > in queue_write_lock_slowpath() will contend with incoming readers > causing possibly extra cmpxchg() operations that are wasteful. This > patch changes

[PATCH v5 3/3] locking/qrwlock: Don't contend with readers when setting _QW_WAITING

2015-06-19 Thread Waiman Long
The current cmpxchg() loop in setting the _QW_WAITING flag for writers in queue_write_lock_slowpath() will contend with incoming readers causing possibly extra cmpxchg() operations that are wasteful. This patch changes the code to do a byte cmpxchg() to eliminate contention with new readers. A mul