Re: [PATCH V5 4/5] md/raid10: improve raid10 discard request
From: Song Liu <song@kernel.org>
Date: 2020-08-28 22:16:18
On Mon, Aug 24, 2020 at 10:43 PM Xiao Ni [off-list ref] wrote:
[...]
quoted hunk ↗ jump to hunk
--- drivers/md/raid10.c | 254 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 253 insertions(+), 1 deletion(-)
[...]
quoted hunk ↗ jump to hunk
+ +static void raid10_end_discard_request(struct bio *bio) +{ + struct r10bio *r10_bio = bio->bi_private; + struct r10conf *conf = r10_bio->mddev->private; + struct md_rdev *rdev = NULL; + int dev; + int slot, repl; + + /* + * We don't care the return value of discard bio + */ + if (!test_bit(R10BIO_Uptodate, &r10_bio->state)) + set_bit(R10BIO_Uptodate, &r10_bio->state);
We don't need the test_bit(), just do set_bit().
quoted hunk ↗ jump to hunk
+ + dev = find_bio_disk(conf, r10_bio, bio, &slot, &repl); + if (repl) + rdev = conf->mirrors[dev].replacement; + if (!rdev) { + /* raid10_remove_disk uses smp_mb to make sure rdev is set to + * replacement before setting replacement to NULL. It can read + * rdev first without barrier protect even replacment is NULL + */ + smp_rmb(); + repl = 0;
repl is no longer used, right?
+ rdev = conf->mirrors[dev].rdev;
[...]
quoted hunk ↗ jump to hunk
+ + if (conf->reshape_progress != MaxSector && + ((bio->bi_iter.bi_sector >= conf->reshape_progress) != + conf->mddev->reshape_backwards)) + geo = &conf->prev;
Do we need to set R10BIO_Previous here? Also, please run some tests with reshape in progress. Thanks, Song