]> git.baikalelectronics.ru Git - kernel.git/commit
md/md0: optimize raid0 discard handling
authorShaohua Li <shli@fb.com>
Mon, 8 May 2017 00:36:24 +0000 (17:36 -0700)
committerShaohua Li <shli@fb.com>
Tue, 9 May 2017 04:18:03 +0000 (21:18 -0700)
commit03fdb4f48b7699c4f659fabd6ee51aab41e75df5
tree2a8cbe3dc1dac31f3769cefc2963cc8bc677fe33
parent74ca15ef20e6e6f67e5b41ebc65eb259f357b146
md/md0: optimize raid0 discard handling

There are complaints that raid0 discard handling is slow. Currently we
divide discard request into chunks and dispatch to underlayer disks. The
block layer will do merge to form big requests. This causes a lot of
request split/merge and uses significant CPU time.

A simple idea is to calculate the range for each raid disk for an IO
request and send a discard request to raid disks, which will avoid the
split/merge completely. Previously Coly tried the approach, but the
implementation was too complex because of raid0 zones. This patch always
split bio in zone boundary and handle bio within one zone. It simplifies
the implementation a lot.

Reviewed-by: NeilBrown <neilb@suse.com>
Acked-by: Coly Li <colyli@suse.de>
Signed-off-by: Shaohua Li <shli@fb.com>
drivers/md/raid0.c