Re: [PATCH -next v3 2/3] block, bfq: refactor the counting of 'num_groups_with_pending_reqs'

From: yukuai (C)
Date: Wed Apr 27 2022 - 21:09:44 EST


在 2022/04/27 20:49, Jan Kara 写道:
On Wed 27-04-22 20:47:21, Yu Kuai wrote:
Currently, bfq can't handle sync io concurrently as long as they
are not issued from root group. This is because
'bfqd->num_groups_with_pending_reqs > 0' is always true in
bfq_asymmetric_scenario().

The way that bfqg is counted into 'num_groups_with_pending_reqs':

Before this patch:
1) root group will never be counted.
2) Count if bfqg or it's child bfqgs have pending requests.
3) Don't count if bfqg and it's child bfqgs complete all the requests.

After this patch:
1) root group is counted.
2) Count if bfqg have at least one bfqq that is marked busy.
3) Don't count if bfqg doesn't have any busy bfqqs.

With this change, the occasion that only one group is activated can be
detected, and next patch will support concurrent sync io in the
occasion.

This patch also rename 'num_groups_with_pending_reqs' to
'num_groups_with_busy_queues'.

Signed-off-by: Yu Kuai <yukuai3@xxxxxxxxxx>

Looks good. Just I think you forgot to remove in_groups_with_pending_reqs,
which is now unused, from bfq_entity.

Will remove it in the next iteration.

Thanks,
Kuai