On Thu, Dec 15, 2016 at 4:20 AM, NeilBrown <neilb@xxxxxxxx> wrote: > >> Hi Neil, >> >> I found a old mail thread below >> http://www.spinics.net/lists/raid/msg52792.html >> >> Likely Alex is trying to fix same bug, right? >> in one reply you suggested to modify the call in make_request >> >> @@ -1207,7 +1207,8 @@ read_again: >> sectors_handled; >> goto read_again; >> } else >> - generic_make_request(read_bio); >> + reschedule_retry(r1_bio); >> return; >> } >> >> >> I append above change, it looks fix the bug, I've run same tests over >> one hour, no hung task anymore. >> >> Do you think this is right fix? Do we still need the change you >> suggested with punt_bios_to_rescuer? > > I don't really like that fix. I suspect it would probably hurt > performance. > > I'd prefer to fix generic_make_request() to process queued requests in a > more sensible order. > Can you please try the following (with all other patches removed)? > Thanks, > NeilBrown Thanks Neil, I will try when back to office, I'm sick at home. > > diff --git a/block/blk-core.c b/block/blk-core.c > index 14d7c0740dc0..3436b6fc3ef8 100644 > --- a/block/blk-core.c > +++ b/block/blk-core.c > @@ -2036,10 +2036,31 @@ blk_qc_t generic_make_request(struct bio *bio) > struct request_queue *q = bdev_get_queue(bio->bi_bdev); > > if (likely(blk_queue_enter(q, false) == 0)) { > + struct bio_list hold; > + struct bio_list lower, same; > + > + /* Create a fresh bio_list for all subordinate requests */ > + bio_list_merge(&hold, &bio_list_on_stack); > + bio_list_init(&bio_list_on_stack); > ret = q->make_request_fn(q, bio); > > blk_queue_exit(q); > > + /* sort new bios into those for a lower level > + * and those for the same level > + */ > + bio_list_init(&lower); > + bio_list_init(&same); > + while ((bio = bio_list_pop(&bio_list_on_stack)) != NULL) > + if (q == bdev_get_queue(bio->bi_bdev)) > + bio_list_add(&same, bio); > + else > + bio_list_add(&lower, bio); > + /* now assemble so we handle the lowest level first */ > + bio_list_merge(&bio_list_on_stack, &lower); > + bio_list_merge(&bio_list_on_stack, &same); > + bio_list_merge(&bio_list_on_stack, &hold); > + > bio = bio_list_pop(current->bio_list); > } else { > struct bio *bio_next = bio_list_pop(current->bio_list); -- Jinpu Wang Linux Kernel Developer ProfitBricks GmbH Greifswalder Str. 207 D - 10405 Berlin Tel: +49 30 577 008 042 Fax: +49 30 577 008 299 Email: jinpu.wang@xxxxxxxxxxxxxxxx URL: https://www.profitbricks.de Sitz der Gesellschaft: Berlin Registergericht: Amtsgericht Charlottenburg, HRB 125506 B Geschäftsführer: Achim Weiss -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html