Re: [RFC PATCH-tip v2 2/6] locking/rwsem: Stop active read lock ASAP

2016-06-15 Thread Waiman Long
On 06/15/2016 01:22 PM, Peter Zijlstra wrote: On Tue, Jun 14, 2016 at 06:48:05PM -0400, Waiman Long wrote: Currently, when down_read() fails, the active read locking isn't undone until the rwsem_down_read_failed() function grabs the wait_lock. If the wait_lock is contended, it may takes a while

Re: [RFC PATCH-tip v2 1/6] locking/osq: Make lock/unlock proper acquire/release barrier

2016-06-15 Thread Waiman Long
On 06/15/2016 01:12 PM, Peter Zijlstra wrote: On Wed, Jun 15, 2016 at 09:56:59AM -0700, Davidlohr Bueso wrote: On Tue, 14 Jun 2016, Waiman Long wrote: +++ b/kernel/locking/osq_lock.c @@ -115,7 +115,7 @@ bool osq_lock(struct optimistic_spin_queue *lock) * cmpxchg in an attempt to undo

[RFC PATCH-tip v2 0/6] locking/rwsem: Enable reader optimistic spinning

2016-06-14 Thread Waiman Long
ock code. Patch 6 enables readers to do optimistic spinning. Waiman Long (6): locking/osq: Make lock/unlock proper acquire/release barrier locking/rwsem: Stop active read lock ASAP locking/rwsem: Enable count-based spinning on reader locking/rwsem: move down rwsem_down_read_failed funct

[RFC PATCH-tip v2 1/6] locking/osq: Make lock/unlock proper acquire/release barrier

2016-06-14 Thread Waiman Long
The osq_lock() and osq_unlock() function may not provide the necessary acquire and release barrier in some cases. This patch makes sure that the proper barriers are provided when osq_lock() is successful or when osq_unlock() is called. Signed-off-by: Waiman Long <waiman.l...@hpe.com> ---

Re: [RFC PATCH-tip 6/6] xfs: Enable reader optimistic spinning for DAX inodes

2016-06-14 Thread Waiman Long
On 06/14/2016 02:24 PM, Christoph Hellwig wrote: On Tue, Jun 14, 2016 at 02:12:39PM -0400, Waiman Long wrote: This patch enables reader optimistic spinning for inodes that are under a DAX-based mount point. On a 4-socket Haswell machine running on a 4.7-rc1 tip-based kernel, the fio test

[RFC PATCH-tip 2/6] locking/rwsem: Enable optional count-based spinning on reader

2016-06-14 Thread Waiman Long
the default 4K (shift = 12) iteration count. Signed-off-by: Waiman Long <waiman.l...@hpe.com> --- include/linux/rwsem.h | 21 - kernel/locking/rwsem-xadd.c | 28 +++- 2 files changed, 39 insertions(+), 10 deletions(-) diff --git a/include

[RFC PATCH-tip 1/6] locking/rwsem: Stop active read lock ASAP

2016-06-14 Thread Waiman Long
--- -- randrw1210 MB/s 1352 MB/s +12% randwrite 1622 MB/s 1710 MB/s +5.4% The write-only microbench also showed improvement because some read locking was done by the XFS code. Signed-off-by: Waiman Long <waiman.l...@hpe.com> ---

[RFC PATCH-tip 6/6] xfs: Enable reader optimistic spinning for DAX inodes

2016-06-14 Thread Waiman Long
% Signed-off-by: Waiman Long <waiman.l...@hpe.com> --- fs/xfs/xfs_icache.c |9 + 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index 99ee6ee..09f284f 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -71,6

[RFC PATCH-tip 5/6] locking/rwsem: Enable spinning readers

2016-06-14 Thread Waiman Long
This patch enables readers to optimistically spin when the rspin_threshold is non-zero. That threshold value should only be set when the lock owners of the rwsem are unlikely to go to sleep. Otherwise enabling reader spinning may make the performance worse in some cases. Signed-off-by: Waiman

[RFC PATCH-tip 4/6] locking/rwsem: Change RWSEM_WAITING_BIAS for better disambiguation

2016-06-14 Thread Waiman Long
+ RWSEM_ACTIVE_READ_BIAS Signed-off-by: Waiman Long <waiman.l...@hpe.com> --- arch/alpha/include/asm/rwsem.h |7 --- arch/ia64/include/asm/rwsem.h |6 +++--- arch/s390/include/asm/rwsem.h |6 +++--- arch/x86/include/asm/rwsem.h | 13 - include/asm-generic/rwsem.h

[RFC PATCH-tip 3/6] locking/rwsem: move down rwsem_down_read_failed function

2016-06-14 Thread Waiman Long
Move the rwsem_down_read_failed() function down to below the optimistic spinning section before enabling optimistic spinning for the readers. There is no change in code. Signed-off-by: Waiman Long <waiman.l...@hpe.com> --- kernel/locking/rwsem-xadd.c

[RFC PATCH-tip 0/6] locking/rwsem: Enable reader optimistic spinning

2016-06-14 Thread Waiman Long
reader optimistic spinning. Patch 6 enables reader optimistic spinning in XFS for inodes that comes from a DAX-enabled mount point on top of persistent memory as the CPUs can do I/O directly without waiting or sleeping. Waiman Long (6): locking/rwsem: Stop active read lock ASAP locking/rwsem

<    1   2