From: Tejun Heo <tj@kernel.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jens Axboe <axboe@kernel.dk>,
linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
darklight2357@icloud.com, Josef Bacik <josef@toxicpanda.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
cgroups@vger.kernel.org
Subject: Re: [PATCH 2/2 block/for-6.2] blk-iolatency: Make initialization lazy
Date: Mon, 12 Dec 2022 12:44:44 -1000 [thread overview]
Message-ID: <Y5eu3A3TMWRUYd+N@slm.duckdns.org> (raw)
In-Reply-To: <Y5bsBuwjcbHEjhIw@infradead.org>
Hello, Christoph.
On Mon, Dec 12, 2022 at 12:53:26AM -0800, Christoph Hellwig wrote:
> > +static int blk_iolatency_try_init(char *input)
> > +{
> > + static DEFINE_MUTEX(init_mutex);
> > + struct block_device *bdev;
> > + int ret = 0;
> > +
> > + bdev = blkcg_conf_open_bdev(&input);
> > + if (IS_ERR(bdev))
> > + return PTR_ERR(bdev);
>
> > +retry:
> > ret = blkg_conf_prep(blkcg, &blkcg_policy_iolatency, buf, &ctx);
> > + if (ret == -EOPNOTSUPP) {
> > + ret = blk_iolatency_try_init(buf);
>
> It's a little sad to do two block device lookups here (even if it
> obviously doesn't matter for performance). I wonder if it would
> make sense to explicitly support the lazy init pattern
> in blkg_conf_prep somehow.
>
> Otherwise I'm all for the lazy init.
Yeah, I thought about separating out open_bdev from blkg_conf_prep() but the
added complexity didn't feel very attractive given the usage pattern. Lemme
take a stab at it. Maybe it won't look too bad.
Thanks.
--
tejun
next prev parent reply other threads:[~2022-12-12 22:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-10 18:33 [PATCH 1/2 block/for-6.2] blk-iolatency: Fix memory leak on add_disk() failures Tejun Heo
2022-12-10 18:34 ` [PATCH 2/2 block/for-6.2] blk-iolatency: Make initialization lazy Tejun Heo
2022-12-12 8:53 ` Christoph Hellwig
2022-12-12 22:44 ` Tejun Heo [this message]
2022-12-10 18:54 ` [PATCH 1/2 block/for-6.2] blk-iolatency: Fix memory leak on add_disk() failures Linus Torvalds
2022-12-12 8:47 ` Christoph Hellwig
2022-12-14 19:43 ` (subset) " Jens Axboe
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=Y5eu3A3TMWRUYd+N@slm.duckdns.org \
--to=tj@kernel.org \
--cc=axboe@kernel.dk \
--cc=cgroups@vger.kernel.org \
--cc=darklight2357@icloud.com \
--cc=hch@infradead.org \
--cc=josef@toxicpanda.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox