raid5: get_active_stripe avoids device_lock
authorShaohua Li <shli@kernel.org>
Wed, 9 Apr 2014 03:27:42 +0000 (11:27 +0800)
committerNeilBrown <neilb@suse.de>
Wed, 9 Apr 2014 04:42:42 +0000 (14:42 +1000)
commite240c1839d11152b0355442f8ac6d2d2d921be36
treebb2f80fd9a3be90a710e2e2053c246ff1dedf6f7
parent27c0f68f0745218cec70f19ba7560c8c5fc3f817
raid5: get_active_stripe avoids device_lock

For sequential workload (or request size big workload), get_active_stripe can
find cached stripe. In this case, we always hold device_lock, which exposes a
lot of lock contention for such workload. If stripe count isn't 0, we don't
need hold the lock actually, since we just increase its count. And this is the
hot code path for such workload. Unfortunately we must delete the BUG_ON.

Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/raid5.c