Message ID | 20220701093441.885741-7-yukuai1@huaweicloud.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | bugfix and cleanup for blk-throttle | expand |
On Fri, Jul 01, 2022 at 05:34:39PM +0800, Yu Kuai wrote: > From: Yu Kuai <yukuai3@huawei.com> > > It's a litter weird to call throtl_dequeue_tg() unconditionally in ^ little > throtl_select_dispatch(), since it will be called in > tg_update_disptime() again if some bio is still throttled. > > Signed-off-by: Yu Kuai <yukuai3@huawei.com> Maybe note that this doesn't create any functional differences in the description? Acked-by: Tejun Heo <tj@kernel.org> Thanks.
diff --git a/block/blk-throttle.c b/block/blk-throttle.c index e690dc1c1cde..ab30efedff4e 100644 --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -1151,13 +1151,13 @@ static int throtl_select_dispatch(struct throtl_service_queue *parent_sq) if (time_before(jiffies, tg->disptime)) break; - throtl_dequeue_tg(tg); - nr_disp += throtl_dispatch_tg(tg); sq = &tg->service_queue; if (sq->nr_queued[READ] || sq->nr_queued[WRITE]) tg_update_disptime(tg); + else + throtl_dequeue_tg(tg); if (nr_disp >= THROTL_QUANTUM) break;