From patchwork Thu Aug 22 15:20: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: 172029 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp1036581ily; Thu, 22 Aug 2019 08:21:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqz6QzgvcdIkhGHECb6xo2ORcbSeakE0ekdPOQy90hBMLPqXV1WrmT5F9gcw4t6pEuiE7KBU X-Received: by 2002:a17:90a:cc13:: with SMTP id b19mr153005pju.117.1566487268310; Thu, 22 Aug 2019 08:21:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566487268; cv=none; d=google.com; s=arc-20160816; b=MfOPsutYiWid7yjuRI4BQq3qMRmGwiu3bsasY6tXbZczDsH+lqaw4RgYwx7cPC66cW aGuRK/XL6uAvgAuC/OQM9mNk03oseFQ33s6oDQJ282m4eWZHYV0uS/3ZdUQfu6Noxn6W 9i65CzUZmAtk7EWHtZ37KkhQ17ZCldlRCZaOilp4f7Lg9TWNJRd9x0nm+f3CuqMuFP+z es+YOUGCnr1RBSLSieF1eSsPX2GyeKWc2LxaelMe12jN+ARJnnwDNs3rp7EMZSpdtXO8 I5n+YZtXXymtsJKw5X4dcFSyaeV+hkLcBiYTxCjUW7IyhNCUJR2+yWoYpS/SMmb78y7u XlIw== 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=WfflNsfWkOa6pDM4wMxWMhDSV9/CiHm7eu3wCLgDzBU=; b=xja7pqJO6vdZXdkvxs0+LyWrFbwRRSFZKLye4VSCM0RlB7W828MSrYi1Sei49/MKKX WJmx1kgbg/7YILAqqS9z0yJXj+QBdr0naOCnLuhGysZJLvjaACjAgv2PQM9DIbekPJu9 oVHff+yZhfaMXzNo++K6GQ44Jy4WZ6XGkLinDTN3YvpLgt2GroUg1C+pIbIuvjhjr4bU 2BuNFNw1nInVwvT7Z4tah6mq2JJJwQKuhF0ykr+XLGGW+Db9rgQB4T9CUqMSH+aPbGsC 3GQe1rMGWoEu5u61u1wpJVE02uA5KyeZmn4rIxvNeCovg7qR+PvCbWa0dHju4X+uByZW 60Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WxubH5IM; 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 19si18169189pfc.239.2019.08.22.08.21.07; Thu, 22 Aug 2019 08:21:08 -0700 (PDT) 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=WxubH5IM; 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 S2389576AbfHVPVH (ORCPT + 28 others); Thu, 22 Aug 2019 11:21:07 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:34119 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727874AbfHVPVD (ORCPT ); Thu, 22 Aug 2019 11:21:03 -0400 Received: by mail-wm1-f66.google.com with SMTP id e8so7328793wme.1 for ; Thu, 22 Aug 2019 08:21:02 -0700 (PDT) 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=WfflNsfWkOa6pDM4wMxWMhDSV9/CiHm7eu3wCLgDzBU=; b=WxubH5IM9oW568/MgT51L+h21Si3KP9c61YYF5GvYWHjdbSIuOZ/m/Eaaie57qoBBH V8hSlixmGOC65GsJmPd0C0vMwWXjyj//eDWScbbXZcZXMyjj6HUdLfXM0lcLyGXG8Oqx GJ5rTPeme/pt21MuzMB/06hQvsegWX/XIxG2MNuRJH8fRCO+IuzLj5xORN4EeKkzY48R 4RnlHXhbuoU8FIWuXnY4575N6dAbeh1VsRMp2bxkHFnqempkE3COghjTH+usytRicBXD p227kQctSISa0SnIurmQfANjWM7hT0+E7Ave92JZVbMYqRwBv8syEH+nUGekI7pIrdhA hhxA== 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=WfflNsfWkOa6pDM4wMxWMhDSV9/CiHm7eu3wCLgDzBU=; b=bCfLzHjDUrg2hZ5GF5vCCI8+MdCFpNUo/XilsQfZPqapuL0GKUg3GFJpXMcpylfcJ0 YYAZj8hlE8kzW+6k8MNQK35inaT/wM2zoQr/degqaiYlrvHGA5cPIAq77nhZP2/o9mYA tp2o97N6A/ZPQfu57o8gVdcz4c3vL5aSWLt06CzW1PBR0NeYTLbzqvCrg4fKAUSEWNG6 9i3EWPjVaSTen9p7HqOSEr4hMIfignYt+8iMlXQEqA/Xhz+OPAAaum1TgN9IItw0GW5o yFLqOGlAYsGPV7FakWYQ/FUIlXFRjylqKX2VWi9rHW2jDYa77DaYHHZQWLE1Xiktys25 CWwg== X-Gm-Message-State: APjAAAWhXwP1WUTG6+cqoqcNfrIwoh0Q2pRIThjI+/QoC3TLUf/bYFC6 iIGiTITZiRr9LP8EAk0075Bi+A== X-Received: by 2002:a1c:a70d:: with SMTP id q13mr7343210wme.26.1566487261463; Thu, 22 Aug 2019 08:21:01 -0700 (PDT) Received: from localhost.localdomain (146-241-115-105.dyn.eolo.it. [146.241.115.105]) by smtp.gmail.com with ESMTPSA id a19sm79833974wra.2.2019.08.22.08.21.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Aug 2019 08:21:01 -0700 (PDT) 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, bfq-iosched@googlegroups.com, oleksandr@natalenko.name, Paolo Valente Subject: [PATCH 2/4] block, bfq: reduce upper bound for inject limit to max_rq_in_driver+1 Date: Thu, 22 Aug 2019 17:20:35 +0200 Message-Id: <20190822152037.15413-3-paolo.valente@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190822152037.15413-1-paolo.valente@linaro.org> References: <20190822152037.15413-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 Upon an increment attempt of the injection limit, the latter is constrained not to become higher than twice the maximum number max_rq_in_driver of I/O requests that have happened to be in service in the drive. This high bound allows the injection limit to grow beyond max_rq_in_driver, which may then cause max_rq_in_driver itself to grow. However, since the limit is incremented by only one unit at a time, there is no need for such a high bound, and just max_rq_in_driver+1 is enough. Signed-off-by: Paolo Valente --- block/bfq-iosched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 5a2bbd8613a8..e114282204f6 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -5805,7 +5805,7 @@ static void bfq_update_inject_limit(struct bfq_data *bfqd, bfqq->inject_limit--; bfqq->decrease_time_jif = jiffies; } else if (tot_time_ns < threshold && - old_limit < bfqd->max_rq_in_driver<<1) + old_limit <= bfqd->max_rq_in_driver) bfqq->inject_limit++; }