X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=block%2Fblk-throttle.c;h=a3ea8260c94c89236f938fb255158be8cb880a73;hb=ce866e2d182b9e00e29e7a2eed4db908257d7f79;hp=f1aba26f47194d2d107717ac769c4e7e7b42bc72;hpb=511a8cdb650544b7efd1bbccf7967d3153aee5f6;p=cascardo%2Flinux.git diff --git a/block/blk-throttle.c b/block/blk-throttle.c index f1aba26f4719..a3ea8260c94c 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -780,9 +780,11 @@ static bool tg_may_dispatch(struct throtl_grp *tg, struct bio *bio, /* * If previous slice expired, start a new one otherwise renew/extend * existing slice to make sure it is at least throtl_slice interval - * long since now. + * long since now. New slice is started only for empty throttle group. + * If there is queued bio, that means there should be an active + * slice and it should be extended instead. */ - if (throtl_slice_used(tg, rw)) + if (throtl_slice_used(tg, rw) && !(tg->service_queue.nr_queued[rw])) throtl_start_new_slice(tg, rw); else { if (time_before(tg->slice_end[rw], jiffies + throtl_slice))