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 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. > 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.