From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yu Kuai Subject: [PATCH -next v7 3/3] block, bfq: do not idle if only one group is activated Date: Sat, 28 May 2022 17:50:20 +0800 Message-ID: <20220528095020.186970-4-yukuai3@huawei.com> References: <20220528095020.186970-1-yukuai3@huawei.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7BIT Return-path: In-Reply-To: <20220528095020.186970-1-yukuai3@huawei.com> List-ID: Content-Type: text/plain; charset="us-ascii" To: tj@kernel.org, axboe@kernel.dk, paolo.valente@linaro.org Cc: cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yi.zhang@huawei.com Now that root group is counted into 'num_groups_with_busy_queues', 'num_groups_with_busy_queues > 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 eb1da1bd5eb4..ffbc2d1593af 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 are one active group at most. * 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_busy_queues > 0 + || bfqd->num_groups_with_busy_queues > 1 #endif ; } -- 2.31.1