From patchwork Tue Jan 29 11:06:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 156965 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4523072jaa; Tue, 29 Jan 2019 03:07:38 -0800 (PST) X-Google-Smtp-Source: ALg8bN4QpUoEHLnb09LptKxu/DRPEzaW/KWmTYOz1vN1U7iNaIlohqm4Y4wOBD7Dq+NyZ+koAJf+ X-Received: by 2002:a17:902:29a7:: with SMTP id h36mr25890931plb.244.1548760058273; Tue, 29 Jan 2019 03:07:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548760058; cv=none; d=google.com; s=arc-20160816; b=rLgiWr83VadNBkfnD+VOoI9IybnJfoR0mMAQ7UbPBzqB5uW7W+7H+3tL1rzjkyR/QG yxVSLVNDJRgb1FBYqmmCrA4er3pijRxOnNoM0AzAL5+ebr3umb3FJXf4Z4Ql0Mx6A3f9 YNYHuEF2rP5q3x48xvYldafib6V/26UKfDa8EZ5xkiq6VChFpUvKUO7+SCDkv8+MZlYI d2P1hIv41Atl3vCH0i+VOh1RmXYyICO3jJnX7d/DwNEo0U7skaQ8j6h1+HDtx1PTizi6 VIJD090UtV25nYkwGrHKTBGKLjj7qcDXj7Cm4S7FJUKJ34+3b/e6Xtm88qfanRwWRxL3 yKcg== 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=/L0sIFrF4VuBSatFaX/8mVU9i1rVnBBzRyuN7LWEkY0=; b=NkbuVcN0wkbQ28uZrdM5fPmCpaLvEE6oPW1ezpoxQghGS+SqsEzHK3lXxN8xXNPF9s zfLuDGfmUQrYHiOq+wgYtX6DwO35uDpdOhkVNgENg3Ola5F/gg47ChvCYCSMa913QRFn xGk4zAawULZJv/onVvRiLqshyAUcxKum7JdREF+3QmqpUSAfAp2SvgqD+XMO23pVU+Zz PngZFWq5ly2ISby3Mu7JMuaazwBeCVaiR22L3bNBN4Uq8+Vflv9SXC2fPKlOgeEHikYK 0jK0MVfTaSDYHFbTxuI5M/hx+QwlCfBW/EgO00JmVJopW66Yg1MMYQGJJC3DthEMBiwN yzVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T8SwCMBx; 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 e129si34632251pgc.333.2019.01.29.03.07.37; Tue, 29 Jan 2019 03:07:38 -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=T8SwCMBx; 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 S1728669AbfA2LHf (ORCPT + 31 others); Tue, 29 Jan 2019 06:07:35 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:56031 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728580AbfA2LHN (ORCPT ); Tue, 29 Jan 2019 06:07:13 -0500 Received: by mail-wm1-f66.google.com with SMTP id y139so17190725wmc.5 for ; Tue, 29 Jan 2019 03:07:12 -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=/L0sIFrF4VuBSatFaX/8mVU9i1rVnBBzRyuN7LWEkY0=; b=T8SwCMBxHn6msupWEQMC7s4HLPYVlg1FbZACnt/EPRze8AUAKrACng21WGluOoVdo2 L7cL+ds9pHdQQ2VaaL4qtXOdX7QcYXDB4xr7IgGJ4/SanZvahBsefcbqgUZLDb0WY7fX j5Vk+mwVIseQWtHLXWsOlAwYh9i8eN/GHSiBQ= 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=/L0sIFrF4VuBSatFaX/8mVU9i1rVnBBzRyuN7LWEkY0=; b=BzrbzDUrPt7rV5UGgpWHSpekPUV0SN4R43jU+lNnVEaD3ogYAwjSnhu/+FgZMkFu/N 1QYDQVaprHd6NoXb7T83QDqfGXppBGyvrXlqDs19gDRMaN+iQ1jZNY1hSFhWqqhGsvY7 egozWY1el8i7zwECXVzBggjve6RodW8LyVkYtlXU0S5q30+tobxWlqUF6rdcXTjJ6Q80 oWYub7SuTBn7/Z7dtZJyCmsu7BOPtiVNMsbz1MtIV48+9h9F/+cow0YHHuHTvKkuQbDS 5cmi54Hjddclg0WwiCy4XHBcvEl4md/zvRABlPapQjYwy3hrjr3w3/e1qTysH7WT3yrc pnQw== X-Gm-Message-State: AJcUukfQDzxjDE97jLpK/OjbDapMXjK/4Yjw1JKRfDBSnwQkFCGMLz0P sn4FZCI5eoQesN2gblwKER0cpg== X-Received: by 2002:a1c:7d06:: with SMTP id y6mr20407313wmc.7.1548760031541; Tue, 29 Jan 2019 03:07:11 -0800 (PST) Received: from localhost.localdomain ([88.147.67.218]) by smtp.gmail.com with ESMTPSA id s132sm2066112wmf.28.2019.01.29.03.07.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Jan 2019 03:07:10 -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, mancha@tower-research.com, Paolo Valente Subject: [PATCH BUGFIX IMPROVEMENT 11/14] block, bfq: reduce threshold for detecting command queueing Date: Tue, 29 Jan 2019 12:06:35 +0100 Message-Id: <20190129110638.12652-12-paolo.valente@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190129110638.12652-1-paolo.valente@linaro.org> References: <20190129110638.12652-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 bfq borrowed from cfq a simple heuristic for detecting whether the drive performs command queueing: check whether the average number of in-flight requests is above a given threshold. Unfortunately this heuristic does fail to detect queueing (on drives with queueing) if processes doing I/O are few and issue I/O with a low depth. To reduce false negatives, this commit lowers the threshold. Signed-off-by: Paolo Valente --- block/bfq-iosched.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index bf585ad29bb5..48b579032d14 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -230,7 +230,7 @@ static struct kmem_cache *bfq_pool; #define BFQ_MIN_TT (2 * NSEC_PER_MSEC) /* hw_tag detection: parallel requests threshold and min samples needed. */ -#define BFQ_HW_QUEUE_THRESHOLD 4 +#define BFQ_HW_QUEUE_THRESHOLD 3 #define BFQ_HW_QUEUE_SAMPLES 32 #define BFQQ_SEEK_THR (sector_t)(8 * 100) @@ -4798,7 +4798,7 @@ static void bfq_update_hw_tag(struct bfq_data *bfqd) * sum is not exact, as it's not taking into account deactivated * requests. */ - if (bfqd->rq_in_driver + bfqd->queued < BFQ_HW_QUEUE_THRESHOLD) + if (bfqd->rq_in_driver + bfqd->queued <= BFQ_HW_QUEUE_THRESHOLD) return; if (bfqd->hw_tag_samples++ < BFQ_HW_QUEUE_SAMPLES)