Skip to content
Commit 29efc390 authored by Shaohua Li's avatar Shaohua Li
Browse files

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: default avatarNeilBrown <neilb@suse.com>
Acked-by: default avatarColy Li <colyli@suse.de>
Signed-off-by: default avatarShaohua Li <shli@fb.com>
parent 2214c260
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment