From: Christoph Hellwig <hch@lst.de>
To: Yu Kuai <yukuai@kernel.org>
Cc: "Jens Axboe" <axboe@kernel.dk>,
"Josef Bacik" <josef@toxicpanda.com>, "Tejun Heo" <tj@kernel.org>,
"Johannes Weiner" <hannes@cmpxchg.org>,
"Michal Koutný" <mkoutny@suse.com>,
"Jonathan Corbet" <corbet@lwn.net>,
"Shuah Khan" <skhan@linuxfoundation.org>,
"Randy Dunlap" <rdunlap@infradead.org>,
"Coly Li" <colyli@fygo.io>,
"Kent Overstreet" <kent.overstreet@linux.dev>,
"Alasdair Kergon" <agk@redhat.com>,
"Mike Snitzer" <snitzer@kernel.org>,
"Mikulas Patocka" <mpatocka@redhat.com>,
"Benjamin Marzinski" <bmarzins@redhat.com>,
"Song Liu" <song@kernel.org>,
"Li Nan" <magiclinan@didiglobal.com>, "Xiao Ni" <xiao@kernel.org>,
"Andreas Gruenbacher" <agruenba@redhat.com>,
"Matthew Wilcox" <willy@infradead.org>, "Jan Kara" <jack@suse.cz>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Chris Li" <chrisl@kernel.org>,
"Kairui Song" <kasong@tencent.com>,
"Kemeng Shi" <shikemeng@huaweicloud.com>,
"Nhat Pham" <nphamcs@gmail.com>,
"Baoquan He" <baoquan.he@linux.dev>,
"Barry Song" <baohua@kernel.org>,
"Youngjun Park" <youngjun.park@lge.com>,
"Nathan Chancellor" <nathan@kernel.org>,
"Nick Desaulniers" <ndesaulniers@google.com>,
"Bill Wendling" <morbo@google.com>,
"Justin Stitt" <justinstitt@google.com>,
"Yu Kuai" <yukuai@fygo.io>, "Christoph Hellwig" <hch@lst.de>,
"Nilay Shroff" <nilay@linux.ibm.com>,
"Tao Cui" <cuitao@kylinos.cn>,
linux-block@vger.kernel.org, cgroups@vger.kernel.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-bcache@vger.kernel.org, dm-devel@lists.linux.dev,
linux-raid@vger.kernel.org, gfs2@lists.linux.dev,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
llvm@lists.linux.dev
Subject: Re: [PATCH v2 2/3] blk-cgroup: store blkcg in bio instead of blkg
Date: Tue, 15 Sep 2026 08:49:50 +0200 [thread overview]
Message-ID: <20260915064950.GA13417@lst.de> (raw)
In-Reply-To: <ef547fdb7a6c8e39a25a1b9473c444f24a0f03be.1789237876.git.yukuai@fygo.io>
On Sun, Sep 13, 2026 at 02:54:39PM +0800, Yu Kuai wrote:
> @@ -6243,10 +6245,17 @@ static void bfq_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
> bool idle_timer_disabled = false;
> blk_opf_t cmd_flags;
> LIST_HEAD(free);
>
> #ifdef CONFIG_BFQ_GROUP_IOSCHED
> + /*
> + * Pin the blkg used to look up bfqg. If this is the first IO for
> + * the blkcg on this queue, create the bfqg before holding bfqd->lock.
> + */
> + if (rq->bio && !bio_flagged(rq->bio, BIO_BLKG_REF))
> + bio_blkg(rq->bio);
Can rq->bio be NULL here? flush or empty passthrough request should
never enter the scheuler.
> if (!cgroup_subsys_on_dfl(io_cgrp_subsys) && rq->bio)
> bfqg_stats_update_legacy_io(q, rq);
But I guess given that the code below checks it, we should at least
be consistent, so I guess it is better to keep it for now.
>
> static inline void dm_bio_record(struct dm_bio_details *bd, struct bio *bio)
> {
> bd->bi_bdev = bio->bi_bdev;
> - bd->bi_flags = bio->bi_flags;
> + /* Restoring an ownership bit cannot recreate the associated reference. */
> + bd->bi_flags = bio->bi_flags & ~(1U << BIO_BLKG_REF);
I have a bit of a hard time parsing this, the line also is overly
long.
next prev parent reply other threads:[~2026-09-15 6:49 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-13 6:54 [PATCH v2 0/3] blk-cgroup: store blkcg in bio before blkcg_mutex conversion Yu Kuai
2026-09-13 6:54 ` [PATCH v2 1/3] blk-cgroup: use a request_queue rhashtable for blkg lookup Yu Kuai
2026-09-13 6:54 ` [PATCH v2 2/3] blk-cgroup: store blkcg in bio instead of blkg Yu Kuai
2026-09-13 13:06 ` Nilay Shroff
2026-09-15 6:49 ` Christoph Hellwig [this message]
2026-09-15 15:43 ` yu kuai
2026-09-13 6:54 ` [PATCH v2 3/3] blk-cgroup: move async bio punt state to blkcg Yu Kuai
2026-09-13 13:29 ` Nilay Shroff
2026-09-15 6:50 ` Christoph Hellwig
2026-09-15 15:54 ` yu kuai
2026-09-16 5:46 ` Nilay Shroff
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=20260915064950.GA13417@lst.de \
--to=hch@lst.de \
--cc=agk@redhat.com \
--cc=agruenba@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=baohua@kernel.org \
--cc=baoquan.he@linux.dev \
--cc=bmarzins@redhat.com \
--cc=cgroups@vger.kernel.org \
--cc=chrisl@kernel.org \
--cc=colyli@fygo.io \
--cc=corbet@lwn.net \
--cc=cuitao@kylinos.cn \
--cc=dm-devel@lists.linux.dev \
--cc=gfs2@lists.linux.dev \
--cc=hannes@cmpxchg.org \
--cc=jack@suse.cz \
--cc=josef@toxicpanda.com \
--cc=justinstitt@google.com \
--cc=kasong@tencent.com \
--cc=kent.overstreet@linux.dev \
--cc=linux-bcache@vger.kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-raid@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=magiclinan@didiglobal.com \
--cc=mkoutny@suse.com \
--cc=morbo@google.com \
--cc=mpatocka@redhat.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=nilay@linux.ibm.com \
--cc=nphamcs@gmail.com \
--cc=rdunlap@infradead.org \
--cc=shikemeng@huaweicloud.com \
--cc=skhan@linuxfoundation.org \
--cc=snitzer@kernel.org \
--cc=song@kernel.org \
--cc=tj@kernel.org \
--cc=willy@infradead.org \
--cc=xiao@kernel.org \
--cc=youngjun.park@lge.com \
--cc=yukuai@fygo.io \
--cc=yukuai@kernel.org \
/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 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.