From patchwork Thu Mar 7 16:25:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 159888 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp7628890jad; Thu, 7 Mar 2019 08:26:52 -0800 (PST) X-Google-Smtp-Source: APXvYqxvWcrx4PBEILGX3tmhdO727ynR6mu98HztqFrSYAyQ1lsmMgCWO6hupmT4xQynxAv/q0ih X-Received: by 2002:a62:1342:: with SMTP id b63mr13444338pfj.7.1551976012296; Thu, 07 Mar 2019 08:26:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551976012; cv=none; d=google.com; s=arc-20160816; b=ekdByeZoE6TS72pgv+L5wgiq+RXqsxMD68mRUGKsX5n4mMudab7LgaOC2ny0ImOx+L M3Poszac1rSg6haWazhLBGxfCO0gDJLEe3b01XVvom/lyAaMUzsitBsMooEjtc/lRv8M ioJh5QVgvDgdYW5c6Y1RVwG9WkmeVnWA2oQaQ/1V2ctTw5aYZQcBvIzE6Fs36pE9/FmB LbN3snWVeQxSzc4Hr6041qQEgoNMfrpkjB9ykAJPHXCiLRsmUdeDl6XIIHzjp++mYDtp xXQ2pHffavxJmxSIQqpaScskQWUS//3vUZXVX4jyCtYG1EquEcQsR8VZxUIaBHGAzOFX hpGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QUHw4uD/6PdjAyafvFS/vFaSGIdhMTKmdDdLyjrgLw8=; b=seUooYhECJbxx0FJvm8ZVYrec3gwjIqDI4rBZFE1AXfLw/Ot4kvPG7nU0nJE5VdZfG uGdV9gJ9K/e4btXPVsIP4Yd94x3EBXionII/5R+pemD7oBqC4TlNWqIQCQDUiIxZKMf/ ZZcN+VS2CraZPHPg3PBbf8FC49dl8tEq1ODzJsUW0YgwQIEHY2kneRZYYSdQPp+WdrP+ N/0c/QpE64pc4JXbfN+5kyXPIzUAX1/HyGuBKSpQJzvJGpYvBpYLY8kH0rzrZfrNTnRf /OeWmOuXmZi5t+aHkpLr8eE2V2zOCpAcUwc2oaMdQNjZ2mTt6O9tC5UOlO1o/JYNiR9n i4uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BiU1VLV7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h1si4513572pll.75.2019.03.07.08.26.51; Thu, 07 Mar 2019 08:26:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BiU1VLV7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726646AbfCGQ0u (ORCPT + 31 others); Thu, 7 Mar 2019 11:26:50 -0500 Received: from mail-wr1-f51.google.com ([209.85.221.51]:39018 "EHLO mail-wr1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726127AbfCGQ0U (ORCPT ); Thu, 7 Mar 2019 11:26:20 -0500 Received: by mail-wr1-f51.google.com with SMTP id l12so1695146wrp.6 for ; Thu, 07 Mar 2019 08:26:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QUHw4uD/6PdjAyafvFS/vFaSGIdhMTKmdDdLyjrgLw8=; b=BiU1VLV7jOAsQD02bezreQzwIST1pRkoNjFNXNMIbkymkn6y1h3pGaiPA1uO5bH2tc cONVastuhjLUsr9yYGpMMEWqjG04/YeI0pJx2g9w5UdpvPEV9TEIFRNCqFwCRkGoU7SM 5EIN1eo1fuCtsw1vF1jDOJvTvgzWRq3xSJqvy3zwSarw+l3WmHSpxHKJlCsUqpIdDweM NUAETypSqhLe60fcKAgBcNIM+d3Yc0HGgMh8spHwJovuYjTV8wS7ygNDRX7m1D25lBDw HOQnCf2m2NqIidufGcDSNtuGKRqDTLQ7alooDns/2LyDYQvekS8HhSPCkWDybqkIzDQh DzBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QUHw4uD/6PdjAyafvFS/vFaSGIdhMTKmdDdLyjrgLw8=; b=R7mHnRiyKjExXTHnVHGaD9uej/3EtiWtFXNizlTNuiWAIcgpNFdwy9hmFZ0vMpWEEr pkuGFJRDKlkDef/3U0xFjq+7ftdp9fOU7DZNI6kXjeZBBrjVD9+OUh5DFU8eXJG47sSX ikCrqffZ/wusBNs4XqNrQQ+4aUhzW0rK3qMai18aWeteKpgaSvD3lKxRF47zKAF3Sx0b 3cgsfGZhxo4+6ZVcz5UYREn80FpTFhiz2uN3NIDvS2v6Y1g4xusyxTpOqt0IpNj6gVWS u+1nJxr5LluNEt8I+w4FvseziW+9Y3bUgv7iOd+WWhnY4Leww8bMidYsX5B8XJum0vCd ZuZw== X-Gm-Message-State: APjAAAVWYomzTp3NqZ/7+IU5fnbmw6zou4OcfktzeDdciAl1FufaTusx MMOmkM1SRaZDTLcyJEe6NS1na7viTVo= X-Received: by 2002:adf:a4c9:: with SMTP id h9mr7363248wrb.254.1551975978016; Thu, 07 Mar 2019 08:26:18 -0800 (PST) Received: from localhost.localdomain (146-241-117-61.dyn.eolo.it. [146.241.117.61]) by smtp.gmail.com with ESMTPSA id o127sm5801797wmo.20.2019.03.07.08.26.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Mar 2019 08:26:17 -0800 (PST) From: Paolo Valente To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, ulf.hansson@linaro.org, linus.walleij@linaro.org, broonie@kernel.org, bfq-iosched@googlegroups.com, oleksandr@natalenko.name, fra.fra.800@gmail.com, Paolo Valente Subject: [PATCH BUGFIX IMPROVEMENT 5/8] block, bfq: do not tag totally seeky queues as soft rt Date: Thu, 7 Mar 2019 17:25:51 +0100 Message-Id: <20190307162554.77205-6-paolo.valente@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190307162554.77205-1-paolo.valente@linaro.org> References: <20190307162554.77205-1-paolo.valente@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sync random I/O is likely to be confused with soft real-time I/O, because it is characterized by limited throughput and apparently isochronous arrival pattern. To avoid false positives, this commits prevents bfq_queues containing only random (seeky) I/O from being tagged as soft real-time. Signed-off-by: Paolo Valente --- block/bfq-iosched.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) -- 2.20.1 diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index b96be3764b8a..d34b80e5c47d 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -242,6 +242,14 @@ static struct kmem_cache *bfq_pool; blk_rq_sectors(rq) < BFQQ_SECT_THR_NONROT)) #define BFQQ_CLOSE_THR (sector_t)(8 * 1024) #define BFQQ_SEEKY(bfqq) (hweight32(bfqq->seek_history) > 19) +/* + * Sync random I/O is likely to be confused with soft real-time I/O, + * because it is characterized by limited throughput and apparently + * isochronous arrival pattern. To avoid false positives, queues + * containing only random (seeky) I/O are prevented from being tagged + * as soft real-time. + */ +#define BFQQ_TOTALLY_SEEKY(bfqq) (bfqq->seek_history & -1) /* Min number of samples required to perform peak-rate update */ #define BFQ_RATE_MIN_SAMPLES 32 @@ -1622,6 +1630,7 @@ static void bfq_bfqq_handle_idle_busy_switch(struct bfq_data *bfqd, */ in_burst = bfq_bfqq_in_large_burst(bfqq); soft_rt = bfqd->bfq_wr_max_softrt_rate > 0 && + !BFQQ_TOTALLY_SEEKY(bfqq) && !in_burst && time_is_before_jiffies(bfqq->soft_rt_next_start) && bfqq->dispatched == 0; @@ -4816,6 +4825,11 @@ bfq_update_io_seektime(struct bfq_data *bfqd, struct bfq_queue *bfqq, { bfqq->seek_history <<= 1; bfqq->seek_history |= BFQ_RQ_SEEKY(bfqd, bfqq->last_request_pos, rq); + + if (bfqq->wr_coeff > 1 && + bfqq->wr_cur_max_time == bfqd->bfq_wr_rt_max_time && + BFQQ_TOTALLY_SEEKY(bfqq)) + bfq_bfqq_end_wr(bfqq); } static void bfq_update_has_short_ttime(struct bfq_data *bfqd,