On Thu, Nov 21, 2019 at 12:13 PM Nigel Croxon <ncroxon@xxxxxxxxxx> wrote: > > > On 11/20/19 2:22 PM, Song Liu wrote: > > On Wed, Nov 20, 2019 at 8:29 AM Nigel Croxon <ncroxon@xxxxxxxxxx> wrote: > >> The MD driver for level-456 should prevent re-reading read errors. > >> > >> For redundant raid it makes no sense to retry the operation: > >> When one of the disks in the array hits a read error, that will > >> cause a stall for the reading process: > >> - either the read succeeds (e.g. after 4 seconds the HDD error > >> strategy could read the sector) > >> - or it fails after HDD imposed timeout (w/TLER, e.g. after 7 > >> seconds (might be even longer) > > I am ok with the idea. But we need to be more careful. > > > >> The user can enable/disable this functionality by the following > >> commands: > >> To Enable: > >> echo 1 > /proc/sys/dev/raid/raid456_retry_read_error > >> > >> To Disable, type the following at anytime: > >> echo 0 > /proc/sys/dev/raid/raid456_retry_read_error > >> > >> Version 2: > >> * Renamed *raid456* to *raid5*. > >> * Changed set_raid5_retry_re routine to use 'if-then' to make cleaner. > >> * Added set_bit R5_ReadError in retry_aligned_read routine. > >> > >> Signed-off-by: Nigel Croxon <ncroxon@xxxxxxxxxx> > >> --- > >> drivers/md/md.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ > >> drivers/md/md.h | 3 +++ > >> drivers/md/raid5.c | 4 +++- > >> 3 files changed, 52 insertions(+), 1 deletion(-) > >> > >> diff --git a/drivers/md/md.c b/drivers/md/md.c > >> index 1be7abeb24fd..6f47489e0b23 100644 > >> --- a/drivers/md/md.c > >> +++ b/drivers/md/md.c > >> @@ -125,6 +125,15 @@ static inline int speed_max(struct mddev *mddev) > >> mddev->sync_speed_max : sysctl_speed_limit_max; > >> } > >> > >> +static int sysctl_raid5_retry_read_error = 0; > > I don't think we need the sysctl. Per device knob should be sufficient. > > Have an example? > > Remember, someone might want to enable this before the initial sync. I think we can enable this for initial sync via /sys/block/mdX/md/xxx. no? Thanks, Song