Linux-Block Archive on
 help / color / Atom feed
From: Chengming Zhou <>
Cc: Chengming Zhou <>
Subject: [PATCH] iocost: Only inc nr_shortages when have io waited
Date: Sun,  2 Aug 2020 01:00:21 +0800
Message-ID: <> (raw)

The last else branch of current code may have not io waited in iocg,
in which case we should not inc nr_shortages, or the device vrate
will speed up even this iocg is not shortage of vtime.

Signed-off-by: Chengming Zhou <>
 block/blk-iocost.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk-iocost.c b/block/blk-iocost.c
index 86ba6fd254e1..ce68b5749364 100644
--- a/block/blk-iocost.c
+++ b/block/blk-iocost.c
@@ -1485,7 +1485,7 @@ static void ioc_timer_fn(struct timer_list *timer)
 				__propagate_active_weight(iocg, iocg->weight,
-		} else {
+		} else if (waitqueue_active(&iocg->waitq)) {
 			/* genuninely out of vtime */

             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-01 17:00 Chengming Zhou [this message]
2020-08-04 14:24 ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-Block Archive on

Archives are clonable:
	git clone --mirror linux-block/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-block linux-block/ \
	public-inbox-index linux-block

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone