Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp965789iol; Thu, 9 Jun 2022 19:06:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAI2iuNVGyDyxgiK4+PEkrKxlOyl2PEbWM1aibmQF9M9k3a6rO3gvvzfLrW2iPyQXCFvYc X-Received: by 2002:a17:902:b282:b0:163:ffe6:2cf9 with SMTP id u2-20020a170902b28200b00163ffe62cf9mr43212537plr.76.1654826779208; Thu, 09 Jun 2022 19:06:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654826779; cv=none; d=google.com; s=arc-20160816; b=mBnMnoU77E/sD7JdmSt+YekocxsxXuNzgXt9LQppp7lCTR47EpfmO+V4u+1HGPiekW GZzs2tRx5zTGQ6/sF7LEzF97hEpTDF3GdrIRIX7SL1aE9bzDnzm1xeypR0JsAbzsiN1v 7l/nwuFMK9e5v/qjQqcsxnuo0fvJxblD7VfcEkagC6wsqSB9X9DAgO1WyoApMKjnLFqf xjAIxCsJfoE4jxQtYWndLdU7PsqN8aj1Xnxxav9HLGi/gOcbEPQiT9Rw6grwAO+vRLfT yVTga2pAw5jDhYRbvJymCgd77EsTaIBslUUhChKjkUhJEHNYD1dN5+qfymi/BGrFaGXT fI4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=fRAi7SEw06pW5KWYSJWx70ygjjdurup3D1F8mQoRnaI=; b=aD/T8oeFaGxmybFhLnowwchC5QM0X0vG9KrWwCe1faP3F4roxxGESZ0FHSp0G83fKU /I53qMAvtHXhYjurWkqvt2SCV1hkuucnNwTDStr3qfa26MIOWPr+MT/8SgbnzCinOeA0 0yw51yZhtW4KfAUj2DSCDTUh13NtEjlzPgYpxg/LNtHwimoy+VcL6xgRqDevZXx6uxEr XBiE3KaB2U22VdzKFYZsghCYRHTV9mlUn6ig1mS5s9XCocckjer/r3Ve/4dvpTOaZG8w r7AuplKa/GN8KyxX/kHPMPAWW6dSK0DBx3WpzSV0Lgr9XgH0SSwse3sfhFl0XjA4xlGZ DyCA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id my6-20020a17090b4c8600b001e87c97ce10si1602220pjb.133.2022.06.09.19.05.59; Thu, 09 Jun 2022 19:06:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346018AbiFJCEa (ORCPT + 99 others); Thu, 9 Jun 2022 22:04:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345916AbiFJCEP (ORCPT ); Thu, 9 Jun 2022 22:04:15 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B083E8A30F; Thu, 9 Jun 2022 19:03:54 -0700 (PDT) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4LK43x2MVTzjX9C; Fri, 10 Jun 2022 10:02:53 +0800 (CST) Received: from kwepemm600009.china.huawei.com (7.193.23.164) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 10 Jun 2022 10:03:52 +0800 Received: from huawei.com (10.175.127.227) by kwepemm600009.china.huawei.com (7.193.23.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 10 Jun 2022 10:03:51 +0800 From: Yu Kuai To: , , , CC: , , , , Subject: [PATCH -next v10 4/4] block, bfq: do not idle if only one group is activated Date: Fri, 10 Jun 2022 10:17:01 +0800 Message-ID: <20220610021701.2347602-5-yukuai3@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220610021701.2347602-1-yukuai3@huawei.com> References: <20220610021701.2347602-1-yukuai3@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600009.china.huawei.com (7.193.23.164) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that root group is counted into 'num_groups_with_pending_reqs', 'num_groups_with_pending_reqs > 0' is always true in bfq_asymmetric_scenario(). Thus change the condition to '> 1'. On the other hand, this change can enable concurrent sync io if only one group is activated. Signed-off-by: Yu Kuai Reviewed-by: Jan Kara --- block/bfq-iosched.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c index 03b04892440c..a2aa243505dc 100644 --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -820,7 +820,7 @@ bfq_pos_tree_add_move(struct bfq_data *bfqd, struct bfq_queue *bfqq) * much easier to maintain the needed state: * 1) all active queues have the same weight, * 2) all active queues belong to the same I/O-priority class, - * 3) there are no active groups. + * 3) there is at most one active group. * In particular, the last condition is always true if hierarchical * support or the cgroups interface are not enabled, thus no state * needs to be maintained in this case. @@ -852,7 +852,7 @@ static bool bfq_asymmetric_scenario(struct bfq_data *bfqd, return varied_queue_weights || multiple_classes_busy #ifdef CONFIG_BFQ_GROUP_IOSCHED - || bfqd->num_groups_with_pending_reqs > 0 + || bfqd->num_groups_with_pending_reqs > 1 #endif ; } -- 2.31.1