summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.h
diff options
context:
space:
mode:
authorSong Liu <songliubraving@fb.com>2017-01-23 17:12:58 -0800
committerShaohua Li <shli@fb.com>2017-01-24 11:20:15 -0800
commit07e83364845e1e1c7e189a01206a9d7d33831568 (patch)
tree5b454f7d444476a4b1c4e1ce2e5b954a638d9923 /drivers/md/raid5.h
parenta85dd7b8df52e35d8ee3794c65cac5c39128fd80 (diff)
downloadlinux-stable-07e83364845e1e1c7e189a01206a9d7d33831568.tar.gz
linux-stable-07e83364845e1e1c7e189a01206a9d7d33831568.tar.bz2
linux-stable-07e83364845e1e1c7e189a01206a9d7d33831568.zip
md/r5cache: shift complex rmw from read path to write path
Write back cache requires a complex RMW mechanism, where old data is read into dev->orig_page for prexor, and then xor is done with dev->page. This logic is already implemented in the write path. However, current read path is not awared of this requirement. When the array is optimal, the RMW is not required, as the data are read from raid disks. However, when the target stripe is degraded, complex RMW is required to generate right data. To keep read path as clean as possible, we handle read path by flushing degraded, in-journal stripes before processing reads to missing dev. Specifically, when there is read requests to a degraded stripe with data in journal, handle_stripe_fill() calls r5c_make_stripe_write_out() and exits. Then handle_stripe_dirtying() will do the complex RMW and flush the stripe to RAID disks. After that, read requests are handled. There is one more corner case when there is non-overwrite bio for the missing (or out of sync) dev. handle_stripe_dirtying() will not be able to process the non-overwrite bios without constructing the data in handle_stripe_fill(). This is fixed by delaying non-overwrite bios in handle_stripe_dirtying(). So handle_stripe_fill() works on these bios after the stripe is flushed to raid disks. Signed-off-by: Song Liu <songliubraving@fb.com> Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers/md/raid5.h')
0 files changed, 0 insertions, 0 deletions