[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4c783fa9-f01b-1f9e-9bcb-0e26431d0d24@huawei.com>
Date: Thu, 28 Apr 2022 09:08:14 +0800
From: "yukuai (C)" <yukuai3@...wei.com>
To: Jan Kara <jack@...e.cz>
CC: <tj@...nel.org>, <axboe@...nel.dk>, <paolo.valente@...aro.org>,
<cgroups@...r.kernel.org>, <linux-block@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <yi.zhang@...wei.com>
Subject: Re: [PATCH -next v3 1/3] block, bfq: record how many queues are busy
in bfq_group
在 2022/04/27 20:52, Jan Kara 写道:
> On Wed 27-04-22 20:47:20, Yu Kuai wrote:
>> Prepare to refactor the counting of 'num_groups_with_pending_reqs'.
>>
>> Add a counter 'busy_queues' in bfq_group, and update it in
>> bfq_add/del_bfqq_busy().
>>
>> Signed-off-by: Yu Kuai <yukuai3@...wei.com>
>
> ...
>
>> diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c
>> index f8eb340381cf..53826797430f 100644
>> --- a/block/bfq-wf2q.c
>> +++ b/block/bfq-wf2q.c
>> @@ -218,6 +218,14 @@ static bool bfq_no_longer_next_in_service(struct bfq_entity *entity)
>> return false;
>> }
>>
>> +static void bfq_update_busy_queues(struct bfq_queue *bfqq, bool is_add)
>> +{
>> + if (is_add)
>> + bfqq_group(bfqq)->busy_queues++;
>> + else
>> + bfqq_group(bfqq)->busy_queues--;
>> +}
>> +
>> #else /* CONFIG_BFQ_GROUP_IOSCHED */
>
> I think the bool argument here unnecessarily hurts readability (it's
> difficult to see what the argument means without looking into the
> implementation). I'd rather create two functions bfq_{inc,dec}_busy_queues()
> or if you really insist on a single function, we can have
> bfq_add_busy_queues() and have 'int' argument that will be +1 or -1.
Thanks for the suggestion, I'll create two functions in next iteration.
>
> Honza
>
Powered by blists - more mailing lists