raid10: improve random reads performance
authorTomasz Majchrzak <tomasz.majchrzak@intel.com>
Fri, 24 Jun 2016 12:20:16 +0000 (14:20 +0200)
committerShaohua Li <shli@fb.com>
Tue, 19 Jul 2016 22:20:28 +0000 (15:20 -0700)
commit0e5313e2d4ef93bdf6c22dad647d28635b86472a
treeb470429e5ae7c501d920a12550bf76592bac04d0
parent573275b58ee9e1d2ec89f9608060f58931c3cde3
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>
drivers/md/raid10.c
drivers/md/raid10.h