From: Jan Kara <jack@suse.cz>
To: Yu Kuai <yukuai3@huawei.com>
Cc: tj@kernel.org, axboe@kernel.dk, paolo.valente@linaro.org,
jack@suse.cz, fchecconi@gmail.com, avanzini.arianna@gmail.com,
cgroups@vger.kernel.org, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, yi.zhang@huawei.com
Subject: Re: [PATCH 1/4] block, bfq: cleanup bfq_bfqq_to_bfqg()
Date: Tue, 21 Dec 2021 11:15:17 +0100 [thread overview]
Message-ID: <20211221101517.GA24748@quack2.suse.cz> (raw)
In-Reply-To: <20211221032135.878550-2-yukuai3@huawei.com>
On Tue 21-12-21 11:21:32, Yu Kuai wrote:
> Use bfq_group() instead, which do the same thing.
>
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Nice. Feel free to add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> block/bfq-iosched.c | 4 ++--
> block/bfq-iosched.h | 1 -
> block/bfq-wf2q.c | 15 ---------------
> 3 files changed, 2 insertions(+), 18 deletions(-)
>
> diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
> index 0c612a911696..2f2b97cad980 100644
> --- a/block/bfq-iosched.c
> +++ b/block/bfq-iosched.c
> @@ -774,7 +774,7 @@ bfq_pos_tree_add_move(struct bfq_data *bfqd, struct bfq_queue *bfqq)
> if (!bfqq->next_rq)
> return;
>
> - bfqq->pos_root = &bfq_bfqq_to_bfqg(bfqq)->rq_pos_tree;
> + bfqq->pos_root = &bfqq_group(bfqq)->rq_pos_tree;
> __bfqq = bfq_rq_pos_tree_lookup(bfqd, bfqq->pos_root,
> blk_rq_pos(bfqq->next_rq), &parent, &p);
> if (!__bfqq) {
> @@ -2669,7 +2669,7 @@ static struct bfq_queue *bfqq_find_close(struct bfq_data *bfqd,
> struct bfq_queue *bfqq,
> sector_t sector)
> {
> - struct rb_root *root = &bfq_bfqq_to_bfqg(bfqq)->rq_pos_tree;
> + struct rb_root *root = &bfqq_group(bfqq)->rq_pos_tree;
> struct rb_node *parent, *node;
> struct bfq_queue *__bfqq;
>
> diff --git a/block/bfq-iosched.h b/block/bfq-iosched.h
> index 07288b9da389..99949548896e 100644
> --- a/block/bfq-iosched.h
> +++ b/block/bfq-iosched.h
> @@ -1051,7 +1051,6 @@ extern struct blkcg_policy blkcg_policy_bfq;
> for (parent = NULL; entity ; entity = parent)
> #endif /* CONFIG_BFQ_GROUP_IOSCHED */
>
> -struct bfq_group *bfq_bfqq_to_bfqg(struct bfq_queue *bfqq);
> struct bfq_queue *bfq_entity_to_bfqq(struct bfq_entity *entity);
> unsigned int bfq_tot_busy_queues(struct bfq_data *bfqd);
> struct bfq_service_tree *bfq_entity_service_tree(struct bfq_entity *entity);
> diff --git a/block/bfq-wf2q.c b/block/bfq-wf2q.c
> index b74cc0da118e..e1f5ca5c1fdb 100644
> --- a/block/bfq-wf2q.c
> +++ b/block/bfq-wf2q.c
> @@ -142,16 +142,6 @@ static bool bfq_update_next_in_service(struct bfq_sched_data *sd,
>
> #ifdef CONFIG_BFQ_GROUP_IOSCHED
>
> -struct bfq_group *bfq_bfqq_to_bfqg(struct bfq_queue *bfqq)
> -{
> - struct bfq_entity *group_entity = bfqq->entity.parent;
> -
> - if (!group_entity)
> - group_entity = &bfqq->bfqd->root_group->entity;
> -
> - return container_of(group_entity, struct bfq_group, entity);
> -}
> -
> /*
> * Returns true if this budget changes may let next_in_service->parent
> * become the next_in_service entity for its parent entity.
> @@ -230,11 +220,6 @@ static bool bfq_no_longer_next_in_service(struct bfq_entity *entity)
>
> #else /* CONFIG_BFQ_GROUP_IOSCHED */
>
> -struct bfq_group *bfq_bfqq_to_bfqg(struct bfq_queue *bfqq)
> -{
> - return bfqq->bfqd->root_group;
> -}
> -
> static bool bfq_update_parent_budget(struct bfq_entity *next_in_service)
> {
> return false;
> --
> 2.31.1
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2021-12-21 10:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-21 3:21 [PATCH 0/4] block, bfq: minor cleanup and fix Yu Kuai
[not found] ` <20211221032135.878550-1-yukuai3-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2021-12-21 3:21 ` [PATCH 1/4] block, bfq: cleanup bfq_bfqq_to_bfqg() Yu Kuai
2021-12-21 10:15 ` Jan Kara [this message]
2021-12-21 3:21 ` [PATCH 2/4] block, bfq: avoid moving bfqq to it's parent bfqg Yu Kuai
[not found] ` <20211221032135.878550-3-yukuai3-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2021-12-21 10:16 ` Jan Kara
2021-12-21 11:08 ` yukuai (C)
[not found] ` <d1c91a5f-33f3-ffad-e1ad-fb91482eb864-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2021-12-21 11:52 ` Jan Kara
2021-12-21 3:21 ` [PATCH 3/4] block, bfq: don't move oom_bfqq Yu Kuai
[not found] ` <20211221032135.878550-4-yukuai3-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2021-12-21 10:18 ` Jan Kara
2021-12-21 3:21 ` [PATCH 4/4] block, bfq: update pos_root for idle bfq_queue in bfq_bfqq_move() Yu Kuai
[not found] ` <20211221032135.878550-5-yukuai3-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2021-12-21 11:50 ` Jan Kara
[not found] ` <20211221115001.GD24748-4I4JzKEfoa/jFM9bn6wA6Q@public.gmane.org>
2021-12-22 3:12 ` yukuai (C)
[not found] ` <6ca1e924-47fa-b94e-598c-69a9549eb68e-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2021-12-22 14:17 ` Jan Kara
2021-12-23 1:03 ` yukuai (C)
2021-12-25 1:19 ` yukuai (C)
[not found] ` <9743fc5a-f3f0-a23a-5d21-0c04c90e90e1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2021-12-25 7:44 ` yukuai (C)
2022-01-03 15:37 ` Jan Kara
2022-01-07 1:04 ` yukuai (C)
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=20211221101517.GA24748@quack2.suse.cz \
--to=jack@suse.cz \
--cc=avanzini.arianna@gmail.com \
--cc=axboe@kernel.dk \
--cc=cgroups@vger.kernel.org \
--cc=fchecconi@gmail.com \
--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 \
--cc=yukuai3@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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox