Re: [PATCH] block: remove per-disk debugfs files in blk_unregister_queue

Ming Lei
2022-05-24T12:14:37Z

On Tue, May 24, 2022 at 02:01:34PM +0200, Christoph Hellwig wrote:
> On Tue, May 24, 2022 at 07:47:03PM +0800, Ming Lei wrote:
> > Not look into details yet, but as one blk-mq debugfs user, I don't like
> > the idea, since I often see io hang issue when calling
> > blk_mq_freeze_queue_wait(), and blk-mq debugfs is very helpful for
> > investigating this kind of issue.
> >
> > But now blk-mq debugfs is gone with this patch __before__ draining IO in
> > del_gendisk, and it becomes not useful as before.
>
> This is the way hot it is set up, so in doubt I want it to be torn down
> synchronously. There might be a way to move the teardown later, but
> that will require a very careful audit.

Then please move it to disk release at least, when blk-mq debug becomes
less useful.

In theory, blk_cleanup_queue() may have similar issue, but most of
drivers release disk after blk_cleanup_queue() except for scsi disk.

So from user viewpoint, the best place to tear down blk-mq debugfs is
still in queue release handler.

Thanks,
Ming