From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3514C10F14 for ; Sun, 6 Oct 2019 17:44:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B97182080F for ; Sun, 6 Oct 2019 17:44:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383847; bh=1gC8dF8dzfLCl1x3XsU1+O9RnKWeN/KhwwtSk3TzVcw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=usOLohHTmoqPtXSmAnzIQb7RQ7nPPebOMsP0J/Mba5wbK1cZzBOITUQezGpQ0Cq7e QDQJrm1q0x85ZzvZ8zlm1neLKZgT4fSxiZnckNLg+HrbWzLHn0OxTO+ybixivTigC9 tFHVLJauztQFKfvNjpO6WIwGRYk6d9e54zzwSLl0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731618AbfJFRoG (ORCPT ); Sun, 6 Oct 2019 13:44:06 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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 -- 2.20.1