Linux-Block Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] iocost: Only inc nr_shortages when have io waited
@ 2020-08-01 17:00 Chengming Zhou
  2020-08-04 14:24 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Chengming Zhou @ 2020-08-01 17:00 UTC (permalink / raw)
  To: axboe, tj, linux-block, linux-kernel; +Cc: Chengming Zhou

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 <zhouchengming@bytedance.com>
---
 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,
 							  new_inuse);
 			}
-		} else {
+		} else if (waitqueue_active(&iocg->waitq)) {
 			/* genuninely out of vtime */
 			nr_shortages++;
 		}
-- 
2.20.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] iocost: Only inc nr_shortages when have io waited
  2020-08-01 17:00 [PATCH] iocost: Only inc nr_shortages when have io waited Chengming Zhou
@ 2020-08-04 14:24 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2020-08-04 14:24 UTC (permalink / raw)
  To: Chengming Zhou; +Cc: axboe, linux-block, linux-kernel

On Sun, Aug 02, 2020 at 01:00:21AM +0800, Chengming Zhou wrote:
> 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 <zhouchengming@bytedance.com>
> ---
>  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,
>  							  new_inuse);
>  			}
> -		} else {
> +		} else if (waitqueue_active(&iocg->waitq)) {

This is intentional. Shortage doesn't necessarily mean that there are
waiters right now. If there are cgroups which don't have enough headroom to
donate and the device is hitting the latency targets, it makes sense to ramp
up vrate as those cgroups are likely to get throttled.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-01 17:00 [PATCH] iocost: Only inc nr_shortages when have io waited Chengming Zhou
2020-08-04 14:24 ` Tejun Heo

Linux-Block Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-block/0 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/ https://lore.kernel.org/linux-block \
		linux-block@vger.kernel.org
	public-inbox-index linux-block

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-block


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git