Re: [PATCH 2/2] locking/qrwlock: Don't contend with readers when setting _QW_WAITING
From: Peter Zijlstra <peterz@infradead.org>
Date: 2015-06-09 12:04:37
Also in:
lkml
From: Peter Zijlstra <peterz@infradead.org>
Date: 2015-06-09 12:04:37
Also in:
lkml
On Mon, Jun 08, 2015 at 06:20:44PM -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 do a byte cmpxchg() to eliminate contention with new readers.
This is very narrow, would not the main cost still be the cacheline transfers? Do you have any numbers to back this? I would feel much better about this if there's real numbers attached.