From: Jan Kara <jack@suse.cz>
To: Yu Kuai <yukuai1@huaweicloud.com>
Cc: jack@suse.cz, tj@kernel.org, josef@toxicpanda.com,
axboe@kernel.dk, paolo.valente@linaro.org,
cgroups@vger.kernel.org, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, yukuai3@huawei.com,
yi.zhang@huawei.com, yangerkun@huawei.com
Subject: Re: [PATCH -next] block, bfq: cleanup 'bfqg->online'
Date: Wed, 1 Feb 2023 14:10:37 +0100 [thread overview]
Message-ID: <20230201131037.6frw2kpc54k4sx7a@quack3> (raw)
In-Reply-To: <20230201120609.4151432-1-yukuai1@huaweicloud.com>
On Wed 01-02-23 20:06:09, Yu Kuai wrote:
> From: Yu Kuai <yukuai3@huawei.com>
>
> After commit dfd6200a0954 ("blk-cgroup: support to track if policy is
> online"), there is no need to do this again in bfq.
>
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
So I agree this is nice to do but it isn't so simple. BFQ relies on the
fact that 'online' is cleared under bfqd->lock so we cannot associate bio
in bfq_bio_bfqg() with a bfqg that has already its bfq_pd_offline()
function run.
Maybe if you set 'online' to false before calling ->pd_offline() things
would work fine for BFQ.
Honza
> ---
> block/bfq-cgroup.c | 4 +---
> block/bfq-iosched.h | 2 --
> 2 files changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c
> index b42956ab5550..a35136dae713 100644
> --- a/block/bfq-cgroup.c
> +++ b/block/bfq-cgroup.c
> @@ -551,7 +551,6 @@ static void bfq_pd_init(struct blkg_policy_data *pd)
> bfqg->bfqd = bfqd;
> bfqg->active_entities = 0;
> bfqg->num_queues_with_pending_reqs = 0;
> - bfqg->online = true;
> bfqg->rq_pos_tree = RB_ROOT;
> }
>
> @@ -614,7 +613,7 @@ struct bfq_group *bfq_bio_bfqg(struct bfq_data *bfqd, struct bio *bio)
> continue;
> }
> bfqg = blkg_to_bfqg(blkg);
> - if (bfqg->online) {
> + if (bfqg->pd.online) {
> bio_associate_blkg_from_css(bio, &blkg->blkcg->css);
> return bfqg;
> }
> @@ -985,7 +984,6 @@ static void bfq_pd_offline(struct blkg_policy_data *pd)
>
> put_async_queues:
> bfq_put_async_queues(bfqd, bfqg);
> - bfqg->online = false;
>
> spin_unlock_irqrestore(&bfqd->lock, flags);
> /*
> diff --git a/block/bfq-iosched.h b/block/bfq-iosched.h
> index 75cc6a324267..69aaee52285a 100644
> --- a/block/bfq-iosched.h
> +++ b/block/bfq-iosched.h
> @@ -1009,8 +1009,6 @@ struct bfq_group {
>
> /* reference counter (see comments in bfq_bic_update_cgroup) */
> refcount_t ref;
> - /* Is bfq_group still online? */
> - bool online;
>
> struct bfq_entity entity;
> struct bfq_sched_data sched_data;
> --
> 2.31.1
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
next prev parent reply other threads:[~2023-02-01 13:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-01 12:06 Yu Kuai
2023-02-01 13:10 ` Jan Kara [this message]
2023-02-02 1:16 ` 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=20230201131037.6frw2kpc54k4sx7a@quack3 \
--to=jack@suse.cz \
--cc=axboe@kernel.dk \
--cc=cgroups@vger.kernel.org \
--cc=josef@toxicpanda.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paolo.valente@linaro.org \
--cc=tj@kernel.org \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=yukuai1@huaweicloud.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
all inboxes | Powered by JetHome®