From: Ming Lei <ming.lei@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org
Subject: Re: [PATCH 0/3] block: don't drain file system I/O on del_gendisk
Date: Mon, 17 Jan 2022 17:08:23 +0800 [thread overview]
Message-ID: <YeUyB/5YtA1AGyt8@T590> (raw)
In-Reply-To: <20220117081321.GA22627@lst.de>
On Mon, Jan 17, 2022 at 09:13:21AM +0100, Christoph Hellwig wrote:
> On Sun, Jan 16, 2022 at 12:18:12PM +0800, Ming Lei wrote:
> > Hello,
> >
> > Draining FS I/O on del_gendisk() is added for just avoiding to refer to
> > recently added q->disk in IO path, and it isn't actually needed.
>
> We need it to have proper life times in the block layer. Everything only
> needed for file system I/O and not blk-mq specific should slowly move
> from the request_queue to the gendisk and I have patches going in
> that direction. In the end only the SCSI discovery code and the case
> of /dev/sg without SCSI ULP will ever do passthrough I/O purely on the
> gendisk.
>
> So I think this series is moving in the wrong direction. If you care
> about no doing two freeze cycles the right thing to do is to record
I just think that the extra draining point in del_gendisk() isn't useful,
can you share any use case with this change?
> if we ever did non-disk based passthrough I/O on a requeue_queue and
> if not simplify the request_queue cleanup. Doing this is on my TODO
> list but I haven't look into the details yet.
>
> > 1) queue freezing can't drain FS I/O for bio based driver
>
> This is something I've started looking into it.
But that is one big problem, not sure you can solve it in short time,
also not sure if it is useful, cause FS already guaranteed that every
IO is drained before releasing disk, or IOs in the submission task are
drained when exiting the task.
>
> > 2) it isn't easy to move elevator/cgroup/throttle shutdown during
> > del_gendisk, and q->disk can still be referred in these code paths
>
> I've also done some prep work to land this cycle here, as all that
> code is only used for FS I/O.
IMO,
Firstly, FS layer has already guaranteed that every FS IO is done before
releasing disk, so no need to take so much effort and make code more
fragile to add one extra FS IO draining point in del_gendisk().
Also the above two things aren't trivial enough to solve in short time, so
can we delay the FS draining in del_gendisk() until the two are done?
Thanks,
Ming
next prev parent reply other threads:[~2022-01-17 9:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-16 4:18 [PATCH 0/3] block: don't drain file system I/O on del_gendisk Ming Lei
2022-01-16 4:18 ` [PATCH 1/3] block: move freeing disk into queue's release handler Ming Lei
2022-01-18 8:22 ` Christoph Hellwig
2022-01-18 15:47 ` Ming Lei
2022-01-18 15:59 ` Ming Lei
2022-01-18 16:19 ` Christoph Hellwig
2022-01-16 4:18 ` [PATCH 2/3] block: revert aec89dc5d421 block: keep q_usage_counter in atomic mode after del_gendisk Ming Lei
2022-01-16 4:18 ` [PATCH 3/3] block: revert 8e141f9eb803 block: drain file system I/O on del_gendisk Ming Lei
2022-01-17 8:13 ` [PATCH 0/3] block: don't " Christoph Hellwig
2022-01-17 9:08 ` Ming Lei [this message]
2022-01-18 8:25 ` Christoph Hellwig
2022-01-19 9: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=YeUyB/5YtA1AGyt8@T590 \
--to=ming.lei@redhat.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--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