diff options
author | Tomasz Majchrzak <tomasz.majchrzak@intel.com> | 2016-06-24 14:20:16 +0200 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2016-07-19 15:20:28 -0700 |
commit | 0e5313e2d4ef93bdf6c22dad647d28635b86472a (patch) | |
tree | b470429e5ae7c501d920a12550bf76592bac04d0 /drivers/md/raid10.h | |
parent | 573275b58ee9e1d2ec89f9608060f58931c3cde3 (diff) | |
download | op-kernel-dev-0e5313e2d4ef93bdf6c22dad647d28635b86472a.zip op-kernel-dev-0e5313e2d4ef93bdf6c22dad647d28635b86472a.tar.gz |
raid10: improve random reads performance
RAID10 random read performance is lower than expected due to excessive spinlock
utilisation which is required mostly for rebuild/resync. Simplify allow_barrier
as it's in IO path and encounters a lot of unnecessary congestion.
As lower_barrier just takes a lock in order to decrement a counter, convert
counter (nr_pending) into atomic variable and remove the spin lock. There is
also a congestion for wake_up (it uses lock internally) so call it only when
it's really needed. As wake_up is not called constantly anymore, ensure process
waiting to raise a barrier is notified when there are no more waiting IOs.
Signed-off-by: Tomasz Majchrzak <tomasz.majchrzak@intel.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/raid10.h')
-rw-r--r-- | drivers/md/raid10.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/raid10.h b/drivers/md/raid10.h index 6fc2c75..18ec1f7 100644 --- a/drivers/md/raid10.h +++ b/drivers/md/raid10.h @@ -64,10 +64,11 @@ struct r10conf { int pending_count; spinlock_t resync_lock; - int nr_pending; + atomic_t nr_pending; int nr_waiting; int nr_queued; int barrier; + int array_freeze_pending; sector_t next_resync; int fullsync; /* set to 1 if a full sync is needed, * (fresh device added). |