From: Tejun Heo <tj@kernel.org>
To: Yu Kuai <yukuai1@huaweicloud.com>
Cc: axboe@kernel.dk, josef@toxicpanda.com,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
cgroups@vger.kernel.org, yi.zhang@huawei.com,
yangerkun@huawei.com, "yukuai (C)" <yukuai3@huawei.com>
Subject: Re: [PATCH v2 1/5] blk-cgroup: add a new helper blkg_print_dev_name()
Date: Thu, 31 Oct 2024 06:55:31 -1000 [thread overview]
Message-ID: <ZyO2g3Lh6rvDd8DP@slm.duckdns.org> (raw)
In-Reply-To: <33183043-335f-fd07-1068-c873656f51d6@huaweicloud.com>
Hello,
On Thu, Oct 31, 2024 at 04:04:00PM +0800, Yu Kuai wrote:
> > On Mon, Sep 30, 2024 at 04:52:58PM +0800, Yu Kuai wrote:
> > > +static inline bool blkg_print_dev_name(struct seq_file *sf,
> > > + struct blkcg_gq *blkg)
> > > +{
> > > + struct gendisk *disk = blkg->q->disk;
> > > +
> > > + if (!disk)
> > > + return false;
> > > +
> > > + seq_printf(sf, "%u:%u", disk->major, disk->first_minor);
> > > + return true;
> > > +}
> > > +
> >
> > I wonder whether we just should add a name field to disk.
>
> And suggestions on this set now? I guess add a name filed is not
> appropriate. :(
Yeah, I don't know. I've always struggled a bit with block device names. We
use MAJ:MIN in all the input interfaces and mix the disk names and MAJ:MIN
when outputting and there are (or is it used to be now?) request_queues
without disk attached, so sometimes names are just not available.
Jens, do you any preference here? The proposed patch can be fine but e.g. it
can race against disk_release() if the caller isn't careful and it also
sucks not knowing the name in destruction path.
Thanks.
--
tejun
next prev parent reply other threads:[~2024-10-31 16:55 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-30 8:52 [PATCH v2 0/5] blk-cgroup: don't abuse bdi in blk-cgroup Yu Kuai
2024-09-30 8:52 ` [PATCH v2 1/5] blk-cgroup: add a new helper blkg_print_dev_name() Yu Kuai
2024-09-30 17:11 ` Tejun Heo
2024-10-08 1:39 ` Yu Kuai
2024-10-08 5:01 ` Christoph Hellwig
2024-10-08 6:24 ` Yu Kuai
2024-10-08 6:29 ` Christoph Hellwig
2024-10-31 8:04 ` Yu Kuai
2024-10-31 16:55 ` Tejun Heo [this message]
2024-09-30 8:52 ` [PATCH 2/5] blk-iocost: use " Yu Kuai
2024-09-30 8:53 ` [PATCH 3/5] blk-throttle: " Yu Kuai
2024-09-30 8:53 ` [PATCH 4/5] blk-iolatency: " Yu Kuai
2024-09-30 8:53 ` [PATCH 5/5] blk-cgroup: " 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=ZyO2g3Lh6rvDd8DP@slm.duckdns.org \
--to=tj@kernel.org \
--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=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 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.