Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1794505rwn; Fri, 16 Sep 2022 00:24:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5cygJJRe4n3q0M+vXp1aNSj9rq3TB5QllJE86JFyO/qjtu0KsLAe2B/hWDaTTTFUF7xcN3 X-Received: by 2002:a63:d30e:0:b0:438:c9c9:7d95 with SMTP id b14-20020a63d30e000000b00438c9c97d95mr3249895pgg.380.1663313052819; Fri, 16 Sep 2022 00:24:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663313052; cv=none; d=google.com; s=arc-20160816; b=VB7AluvcCsTrf2/OXGn932GTdjHRt8DNMRp4hfaHiTgkbDxztKHw2d12I+CVp5YIwB vc0QRVHt4uOU+1UOyQqkZd7cXCGfZJb8iPLCVoXMQyx6O45nPSZLTVkRnDy6bsDfMjgN ZmQBdOWyf+UpeErj6dd+2HhuOEhq1sRtmyv5VsR5+R9Wt/k72hPdlUaT+0JReDEOqOJ7 fQ5CriG4lYOVwdl3FHvzyFG/9E8S2qUAixe2LPL33TaR9aOP5hzwSlPm7oLoFD/Z0j+n ncW675OTf7UL5SxwfsrOKiduGFvp5jYiTL02q0JUdGt+4pvhYtAiG9g5kkJCOyzHZUn+ cyPA== 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=6KMJQP5DZm6qF+/kGwyOA2dUlqphUp8494adLHWk0mo=; b=Gd0BbueFC2V8Da8L/Hbp4TPGcMNV1hQfENsUbZ0THgaNnRcZeeQsCwNi/YUYfYjxH6 FJECqpZj/1TwWj9k37ZVJWYQI5SEIXGBI/dpmI8MCh0PwdKN/pBSNpxCkw0eb5fRbpXu Q9CZ/JBBF2P469o0d+0yJtDPBGGi9Qftm5mMvgI2OAlxWQbijqhH7aTkN1JSYqI3l3/N 1FTJzhNj67oxKwopIj8MpfQNMB/ALCdGjFzu5HetpLeXo2FvvMTnrWp3qMjvE6o+y8zt ADo/7/t8rgKVaECmCEFyNf7CfUiMM0AtWdVbzILYgrqk5UR3IzWA8vfFEKICURS4stYN 4Z8w== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i15-20020a170902cf0f00b0016d5fcd3f51si20339037plg.442.2022.09.16.00.23.57; Fri, 16 Sep 2022 00:24:12 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230220AbiIPHJV (ORCPT + 99 others); Fri, 16 Sep 2022 03:09:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229959AbiIPHIx (ORCPT ); Fri, 16 Sep 2022 03:08:53 -0400 Received: from dggsgout12.his.huawei.com (dggsgout12.his.huawei.com [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A3E0A3D30; Fri, 16 Sep 2022 00:08:52 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4MTQ9X54Cbz6S1ll; Fri, 16 Sep 2022 15:06:56 +0800 (CST) Received: from huaweicloud.com (unknown [10.175.127.227]) by APP2 (Coremail) with SMTP id Syh0CgD3SXP9ICRj02qwAw--.33483S8; Fri, 16 Sep 2022 15:08:50 +0800 (CST) From: Yu Kuai To: tj@kernel.org, axboe@kernel.dk, paolo.valente@linaro.org, jack@suse.cz Cc: cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yukuai1@huaweicloud.com, yi.zhang@huawei.com Subject: [patch v11 4/6] block, bfq: do not idle if only one group is activated Date: Fri, 16 Sep 2022 15:19:40 +0800 Message-Id: <20220916071942.214222-5-yukuai1@huaweicloud.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220916071942.214222-1-yukuai1@huaweicloud.com> References: <20220916071942.214222-1-yukuai1@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: Syh0CgD3SXP9ICRj02qwAw--.33483S8 X-Coremail-Antispam: 1UD129KBjvJXoW7CFWUtr4fKr15Kw1xCw15Jwb_yoW8Gw48pa 9Igw4UCr1kAFnxXFW5WF4xX34kCa1kury7JF90934FyrWaqr9Fq3ZFk3WFv3W8XF93twsF vry5CryDZw17taDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUPY14x267AKxVWrJVCq3wAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2048vs2IY020E87I2jVAFwI0_JF0E3s1l82xGYI kIc2x26xkF7I0E14v26ryj6s0DM28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2 z4x0Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j6F 4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oVCq 3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7 IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4U M4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628vn2 kIc2xKxwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E 14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIx kGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAF wI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r 4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0JUQSdkU UUUU= X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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 From: Yu Kuai 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 970b302a7a3e..6d95b0e488a8 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