From: Ming Lei <ming.lei@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org
Subject: Re: [PATCH] ublk_drv: fix request queue leak
Date: Thu, 14 Jul 2022 21:20:24 +0800 [thread overview]
Message-ID: <YtAYGMvQ+N4RsJRG@T590> (raw)
In-Reply-To: <YtAWhRdXrumYEsU+@infradead.org>
On Thu, Jul 14, 2022 at 06:13:41AM -0700, Christoph Hellwig wrote:
> On Thu, Jul 14, 2022 at 06:32:01PM +0800, Ming Lei wrote:
> > However, ublk may not add disk in case of starting device failure, then
> > del_gendisk() won't be called when removing ublk device, so blk_mq_exit_queue
> > will not be callsed, and it can be bit hard to deal with this kind of
> > merge conflict.
>
> So base it on a tree that has everything you need.
>
> > Turns out ublk's queue/disk use model is very similar with scsi, so switch
> > to scsi's model by allocating disk and queue independently, then it can be
> > quite easy to handle v5.20 merge conflict by replacing blk_cleanup_queue
> > with blk_mq_destroy_queue.
>
> Don't do that. That thing really is a workaround for the lack of admin
> queues in scsi. Nothing newly designed should use it. It will not
> allow to optimize things and cause maintainaince burden down the road.
The problem is that you moved part of blk_cleanup_queue() into
del_gendisk().
Here, the issue Jens reproduced is that we don't add disk yet, so won't
call del_gendisk(). The queue & disk is allocated & initialized correctly.
Then how to do the part done by original blk_cleanup_queue() without calling
blk_mq_destroy_queue()?
Thanks,
Ming
next prev parent reply other threads:[~2022-07-14 13:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-14 10:32 [PATCH] ublk_drv: fix request queue leak Ming Lei
2022-07-14 13:00 ` Jens Axboe
2022-07-14 13:10 ` Ming Lei
2022-07-14 13:14 ` Jens Axboe
2022-07-14 13:24 ` Christoph Hellwig
2022-07-14 13:13 ` Christoph Hellwig
2022-07-14 13:20 ` Ming Lei [this message]
2022-07-14 13:23 ` Christoph Hellwig
2022-07-14 13:26 ` Ming Lei
2022-07-14 13:37 ` Ming Lei
2022-07-14 13:55 ` Christoph Hellwig
2022-07-14 14:02 ` Ming Lei
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=YtAYGMvQ+N4RsJRG@T590 \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=hch@infradead.org \
--cc=linux-block@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox