From: "yukuai (C)" <yukuai3@huawei.com> To: Jan Kara <jack@suse.cz> Cc: <tj@kernel.org>, <axboe@kernel.dk>, <paolo.valente@linaro.org>, <cgroups@vger.kernel.org>, <linux-block@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <yi.zhang@huawei.com> Subject: Re: [PATCH -next v3 1/3] block, bfq: record how many queues are busy in bfq_group Date: Thu, 28 Apr 2022 09:08:14 +0800 [thread overview] Message-ID: <4c783fa9-f01b-1f9e-9bcb-0e26431d0d24@huawei.com> (raw) In-Reply-To: <20220427125251.yl7ff4ti33w6ktrf@quack3.lan> 在 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@huawei.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 >
WARNING: multiple messages have this Message-ID (diff)
From: "yukuai (C)" <yukuai3@huawei.com> To: Jan Kara <jack@suse.cz> Cc: tj@kernel.org, axboe@kernel.dk, paolo.valente@linaro.org, cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yi.zhang@huawei.com Subject: Re: [PATCH -next v3 1/3] block, bfq: record how many queues are busy in bfq_group Date: Thu, 28 Apr 2022 09:08:14 +0800 [thread overview] Message-ID: <4c783fa9-f01b-1f9e-9bcb-0e26431d0d24@huawei.com> (raw) In-Reply-To: <20220427125251.yl7ff4ti33w6ktrf@quack3.lan> ÔÚ 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@huawei.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 >
next prev parent reply other threads:[~2022-04-28 1:08 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-04-27 12:47 [PATCH -next v3 0/3] support concurrent sync io for bfq on a specail occasion Yu Kuai 2022-04-27 12:47 ` Yu Kuai 2022-04-27 12:47 ` [PATCH -next v3 1/3] block, bfq: record how many queues are busy in bfq_group Yu Kuai 2022-04-27 12:47 ` Yu Kuai 2022-04-27 12:52 ` Jan Kara 2022-04-28 1:08 ` yukuai (C) [this message] 2022-04-28 1:08 ` yukuai (C) 2022-04-27 12:47 ` [PATCH -next v3 2/3] block, bfq: refactor the counting of 'num_groups_with_pending_reqs' Yu Kuai 2022-04-27 12:47 ` Yu Kuai 2022-04-27 12:49 ` Jan Kara 2022-04-27 12:49 ` Jan Kara 2022-04-28 1:09 ` yukuai (C) 2022-04-28 1:09 ` yukuai (C) 2022-04-27 12:47 ` [PATCH -next v3 3/3] block, bfq: do not idle if only one group is activated Yu Kuai 2022-04-27 12:47 ` Yu Kuai
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=4c783fa9-f01b-1f9e-9bcb-0e26431d0d24@huawei.com \ --to=yukuai3@huawei.com \ --cc=axboe@kernel.dk \ --cc=cgroups@vger.kernel.org \ --cc=jack@suse.cz \ --cc=linux-block@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=paolo.valente@linaro.org \ --cc=tj@kernel.org \ --cc=yi.zhang@huawei.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.