]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
raid5: make release_stripe lockless
authorShaohua Li <shli@kernel.org>
Tue, 27 Aug 2013 09:50:39 +0000 (17:50 +0800)
committerNeilBrown <neilb@suse.de>
Wed, 28 Aug 2013 01:55:53 +0000 (11:55 +1000)
commit773ca82fa1ee58dd1bf88b6a5ca385ec83a2cac6
tree9dd6c1d72a9fab76d668ae2500e98003290c75a4
parent260fa034ef7a4ff8b73068b48ac497edd5217491
raid5: make release_stripe lockless

release_stripe still has big lock contention. We just add the stripe to a llist
without taking device_lock. We let the raid5d thread to do the real stripe
release, which must hold device_lock anyway. In this way, release_stripe
doesn't hold any locks.

The side effect is the released stripes order is changed. But sounds not a big
deal, stripes are never handled in order. And I thought block layer can already
do nice request merge, which means order isn't that important.

I kept the unplug release batch, which is unnecessary with this patch from lock
contention avoid point of view, and actually if we delete it, the stripe_head
release_list and lru can share storage. But the unplug release batch is also
helpful for request merge. We probably can delay wakeup raid5d till unplug, but
I'm still afraid of the case which raid5d is running.

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