From patchwork Sun Oct 6 17:21:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 175298 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp3308739ill; Sun, 6 Oct 2019 10:44:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPaRoio8TFvvMOA0CwiafNh6DeUSj8DVDQ/i12WKxO7nAGIWFkyMSSwEnZrMztW2zBrCFG X-Received: by 2002:a17:906:90d4:: with SMTP id v20mr21014073ejw.189.1570383844088; Sun, 06 Oct 2019 10:44:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570383844; cv=none; d=google.com; s=arc-20160816; b=i/eC2d0jHHEio9W+aY7+ZSh5I9hHA47yBxUzUM9IxdnqhkwSmg3rIpkvmUFs4wHDEO 6Hq7rBLiHN+vnImK8iwwQLEMfz+xvoun276PNoySrAuSPYUUrJXvnEiStlKts/MFTBH5 /0uF38EasgRhwITxhckDJu76xEQMpWOiw073GTkm0LePTJV4fWy4QhHN6sVoEKjIgAoq sJJ95Ij+Sz4RRosNyBhh3UztIVnRctiLtrnDESKNEeOfJcmpRUTcTc+t2g+T5fVuwv4I /Ps1JBqAl7/XE/jcbp9EhO1NgyynmOHlEc6QnLbApldYyh0IQNhFro/DiJKf3dcP8/Xx BOiw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lbFJ3ZeWUsXTvuCqy0xG+5Sy1AMck9H7AyYWb5NxUdc=; b=mPpYFebHJ+qvjPdyOnshGNTGYbGvQkA2MW1aC6TiTeX41040s76rsxaYW+32uuOK9t KQMkKz10LZztVm02rhnL7QG6blthgKMgDjAsuMf73P4i5egylcKZBa4tAkPOAWO/5qOu GrSlNEERVODcALbLP732Nd2hkOqVzb7M8HpiX+VK6qChy4Ub4+/SNtVdj07dyZ3hx5bZ Np9KMCnyaa+DkQ8Vpy9j5BSFgowB1c6zBcIQjismAVM2lvpJJ+ZFpWZzXrsBcGA8h6kV RewnehE0X1/X7DgyRyyl5Coq+mepcePdeewuP/81nFuZHa1fo/KG/5pvcLB8A/xWQ9xU 37xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NY0OV9aM; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w34si7625802edc.252.2019.10.06.10.44.03; Sun, 06 Oct 2019 10:44:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=@kernel.org header.s=default header.b=NY0OV9aM; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731023AbfJFRoD (ORCPT + 14 others); Sun, 6 Oct 2019 13:44:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:44142 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731598AbfJFRoB (ORCPT ); Sun, 6 Oct 2019 13:44:01 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A900D20700; Sun, 6 Oct 2019 17:44:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383841; bh=1gC8dF8dzfLCl1x3XsU1+O9RnKWeN/KhwwtSk3TzVcw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NY0OV9aMq/VNql3FX8nby40asCWs1cPPk5iN6N5Bq1IvQvr0ujnDdfiETldsH/2ys tnf4V5erajSv+RZ2EIgln255YnphoJLXaG3lgJ3p7Uk8tYN9hVJzRbQzME0xwDd1XK sFqVDMP04GuuiSHtWKsfGzd33w8+9MDmHBWn7sAQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Oleksandr Natalenko , Paolo Valente , Jens Axboe , Sasha Levin Subject: [PATCH 5.3 114/166] block, bfq: push up injection only after setting service time Date: Sun, 6 Oct 2019 19:21:20 +0200 Message-Id: <20191006171222.946938472@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171212.850660298@linuxfoundation.org> References: <20191006171212.850660298@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Paolo Valente [ Upstream commit 58494c980f40274c465ebfdece02d401def088bf ] 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. Tested-by: Oleksandr Natalenko Signed-off-by: Paolo Valente Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- 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 b33be928d164f..70bcbd02edcb1 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -5809,12 +5809,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