From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754632AbdKIWTe (ORCPT ); Thu, 9 Nov 2017 17:19:34 -0500 Received: from mail-qk0-f178.google.com ([209.85.220.178]:46319 "EHLO mail-qk0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751174AbdKIWTd (ORCPT ); Thu, 9 Nov 2017 17:19:33 -0500 X-Google-Smtp-Source: AGs4zMacByKR36Fdw1luLeRl3BbJyJEDpE1HlL9LEXhNY9LhRrq1kI1z9AAkAjwfGNf0RpLJE4oajQ== Date: Thu, 9 Nov 2017 14:19:24 -0800 From: Tejun Heo To: Jens Axboe , Shaohua Li Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: [PATCH 1/2] blk-throtl: make latency= absolute Message-ID: <20171109221924.GB983427@devbig577.frc2.facebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, the latency= parameter specifies the extra latency on top of the estimated baseline latency. This doesn't seem ideal for the following two reasons. 1. Sometimes we want to use absolute target latencies, especially as the baseline latency estimation isn't always reliable. 2. If we want to set a latency target relative to the estimated baseline latency, it makes a lot more sense to express the target as a percentage of the baseline (say, 120% of the expected latency) rather than the baseline latency + an absolute offset. This patch makes the existing latency= parameter to be interpreted as an absolute latency target instead of an offset to the baseline. The next patch will add support for relative latency target expressed in terms of percentage. While this is a userland visible change, io.low support is still evoling and highly experimental. This isn't expected to break any actual usages. Signed-off-by: Tejun Heo Cc: Shaohua Li --- block/blk-throttle.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/block/blk-throttle.c +++ b/block/blk-throttle.c @@ -2299,8 +2299,7 @@ void blk_throtl_bio_endio(struct bio *bi bucket = request_bucket_index( blk_stat_size(&bio->bi_issue_stat)); - threshold = tg->td->avg_buckets[bucket].latency + - tg->latency_target; + threshold = tg->latency_target; if (lat > threshold) tg->bad_bio_cnt++; /*