raid5: only wakeup necessary threads
authorShaohua Li <shli@kernel.org>
Thu, 29 Aug 2013 07:40:32 +0000 (15:40 +0800)
committerNeilBrown <neilb@suse.de>
Mon, 2 Sep 2013 00:31:29 +0000 (10:31 +1000)
If there are not enough stripes to handle, we'd better not always
queue all available work_structs. If one worker can only handle small
or even none stripes, it will impact request merge and create lock
contention.

With this patch, the number of work_struct running will depend on
pending stripes number. Note: some statistics info used in the patch
are accessed without locking protection. This should doesn't matter,
we just try best to avoid queue unnecessary work_struct.

Signed-off-by: Shaohua Li <shli@fusionio.com>
Signed-off-by: NeilBrown <neilb@suse.de>

No differences found