|
@@ -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
|
|
* If previous slice expired, start a new one otherwise renew/extend
|
|
* existing slice to make sure it is at least throtl_slice interval
|
|
* 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);
|
|
throtl_start_new_slice(tg, rw);
|
|
else {
|
|
else {
|
|
if (time_before(tg->slice_end[rw], jiffies + throtl_slice))
|
|
if (time_before(tg->slice_end[rw], jiffies + throtl_slice))
|