md/raid56: Don't perform reads to support writes until stripe is ready.
commit 67f45548 upstream. If it is found that we need to pre-read some blocks before a write can succeed, we normally set STRIPE_DELAYED and don't actually perform the read until STRIPE_PREREAD_ACTIVE subsequently gets set. However for a degraded RAID6 we currently perform the reads as soon as we see that a write is pending. This significantly hurts throughput. So: - when handle_stripe_dirtying find a block that it wants on a device that is failed, set STRIPE_DELAY, instead of doing nothing, and - when fetch_block detects that a read might be required to satisfy a write, only perform the read if STRIPE_PREREAD_ACTIVE is set, and if we would actually need to read something to complete the write. This also helps RAID5, though less often as RAID5 supports a read-modify-write cycle. For RAID5 the read is performed too early only if the write is not a full 4K aligned write (i.e. no an R5_OVERWRITE). Also clean up a couple of horrible bits of formatting. Reported-by:Patrik Horník <patrik@dsl.sk> Signed-off-by:
NeilBrown <neilb@suse.de> [ kamal: 3.13-stable preqreq for 108cef3a "md/raid5: fetch_block must fetch all the blocks ..." ] Signed-off-by:
Kamal Mostafa <kamal@canonical.com>
Showing
Please register or sign in to comment