From patchwork Thu Aug 22 15:20:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Valente X-Patchwork-Id: 172031 Delivered-To: patch@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp1036845ily; Thu, 22 Aug 2019 08:21:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxKHVJAh7yOWBTZ5XbmfZG2Ao9KdAcZOd7dT7UihvGtzLYlSSkp4QUblskN3S1apwh7oZIS X-Received: by 2002:a17:902:bc49:: with SMTP id t9mr40251781plz.277.1566487280035; Thu, 22 Aug 2019 08:21:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566487280; cv=none; d=google.com; s=arc-20160816; b=hMoIyNXndq7P9Fyxmt73Uz2W8FzMnwe5VjxRUmH+7fhUDatkUtL9k6Gkb/ua97W+rP VkbENiBn1DE0I3gfx6SRyJV4I+HviuuSQN5trIIzR6Mwz6LMGr8Ej17f2KylDwSqDH88 QpESjYAnRrTGNpTjMYH0V/lO6wLtkFV5U2oX/iEhVivsqOAJ/9ihUu9bVjeqAUkqi++W 3ypr8RJQM+UWjUKDEMWCrHitDPgalHrCWUF7dWV8GBmRrOCIxYk9aiLi6izgON4N4DAN UL0BQMhFq4+1J/le0v3gSjQTMVNkqWX4YcHwbml8SKyftgjqYcXBSVs1q9KPAGNgRORr OB4g== 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=dQo/3gCQPUZclinUkVyhVJImer3HlnMgJva1KNL7p2s=; b=eg1sTJ0gw/CCWRmKBm/5RgUEmmab0Swb+wru30a300NV3MtagNzlXH5Hd6V6z3u5Mk VQKeQUYp5FDwcRmysqTnEU7phufvfJfN2j4ytq/lKtbEEMV5c3ryYAH4F935v6PSDE3h djQsuybLBs9iL/c2kDvICsKISs2dxaEoIPAW/gc6WNltiva/kpLkwZqtkEYciL9bRzvW xVc44ROSV8fVU7hkNteWRIL6/vem5q2pCANbq3xtuq7K0LmR4e8pIYSzfIRKa5ieqJ5y mA0lveEPtvyazCZvqa+UwJeDGNI/shj4cZCm1aPQPjZo6uZO+2Q945v1/ueae5pcav0B 10GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CPtPkL7r; 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 g13si17086895pgr.297.2019.08.22.08.21.15; Thu, 22 Aug 2019 08:21:20 -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=CPtPkL7r; 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 S2389586AbfHVPVN (ORCPT + 28 others); Thu, 22 Aug 2019 11:21:13 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:36021 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389554AbfHVPVF (ORCPT ); Thu, 22 Aug 2019 11:21:05 -0400 Received: by mail-wm1-f68.google.com with SMTP id g67so6198545wme.1 for ; Thu, 22 Aug 2019 08:21:04 -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=dQo/3gCQPUZclinUkVyhVJImer3HlnMgJva1KNL7p2s=; b=CPtPkL7rqtuuqAFgy+uhFEw2Nx8tcwkjur3v/fj0Adcr4K8/+LteVFwtZIl5s++8GK 6LInXMWdf7WoaVYbrfrOWZQKfRU5uAw1gR/f1UuVhuGxkizCnYXhvtqzlm3HU/kuWrWw XPUWMGwuLQ51wWbkPpXxXa3aeSuqHwiSpEOZvZTHaI4KXRRGsl9a0hTCDumOcFj3OQbf p8wIRavzYFIeRoSPkXhQhkcAtdqPh7I64AWh8IEV8c/WjqpSYj+Xl180r4y8hO2oRyLe AU1ws1HIxNV3oaFTaa8hR2Z5PsZ77+sbGNq+svtVGpbGy6nXkaZWliogDeh33zV3CZNx 5Zmw== 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=dQo/3gCQPUZclinUkVyhVJImer3HlnMgJva1KNL7p2s=; b=JjfoUbjL3DHroMtiTx9GNP58ndl+EBP0nH4UqK0MM3ckfVx2A58X/S9xkLtUkeV9lQ xXRoeOdsN05yMnZOGEk8HHUrLwNJ3G+4HrUASiPp8tju8l7IgGQIH0+203C8gEQou997 uvdimeixwugqWdWF9nD4gNvY1xta472pcIBr3jehSfBDB3U/o7WRdJVreNJi3g0JME7u StCOyXgZdFtrfxki30I98QQ1P+p3x3eNFADApmD9cRcCTfwQnpJ0+HVEq3Qa1WWE+Htw XtB7pTHnYmDKsMin0L9hPzqbchJHo/GWgdHb8Ue9goKk1PLXUdZKK2OiHa0Sz4PLZmlJ aUwg== X-Gm-Message-State: APjAAAV4vNaL6iomLlbmU4oYcj9Gu7pwFaMgDVSLMcKXRJ7FYz8cynym rWIx1BUkrO7vFloViBrg6SdzFyh7oEM= X-Received: by 2002:a7b:c246:: with SMTP id b6mr7330814wmj.13.1566487263542; Thu, 22 Aug 2019 08:21:03 -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.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Aug 2019 08:21:03 -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 4/4] block, bfq: push up injection only after setting service time Date: Thu, 22 Aug 2019 17:20:37 +0200 Message-Id: <20190822152037.15413-5-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 If equal to 0, the injection limit for a bfq_queue is pushed to 1 after a first sample of the total service time of the I/O requests of the queue is computed (to allow injection to start). Yet, because of a mistake in the branch that performs this action, the push may happen also in some other case. This commit fixes this issue. Signed-off-by: Paolo Valente --- block/bfq-iosched.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) -- 2.20.1 diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index ddac93e910fa..0319d6339822 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -5823,12 +5823,14 @@ static void bfq_update_inject_limit(struct bfq_data *bfqd, */ if ((bfqq->last_serv_time_ns == 0 && bfqd->rq_in_driver == 1) || tot_time_ns < bfqq->last_serv_time_ns) { + if (bfqq->last_serv_time_ns == 0) { + /* + * Now we certainly have a base value: make sure we + * start trying injection. + */ + bfqq->inject_limit = max_t(unsigned int, 1, old_limit); + } bfqq->last_serv_time_ns = tot_time_ns; - /* - * Now we certainly have a base value: make sure we - * start trying injection. - */ - bfqq->inject_limit = max_t(unsigned int, 1, old_limit); } else if (!bfqd->rqs_injected && bfqd->rq_in_driver == 1) /* * No I/O injected and no request still in service in