Re: [PATCH 3/4] nvme-apple: move blk_mq_update_nr_hw_queues after nvme_unfreeze
From: Keith Busch <kbusch@kernel.org>
Date: 2026-02-10 16:01:17
Also in:
asahi, linux-block, linux-nvme
From: Keith Busch <kbusch@kernel.org>
Date: 2026-02-10 16:01:17
Also in:
asahi, linux-block, linux-nvme
On Tue, Feb 10, 2026 at 04:41:08PM +0100, Christoph Hellwig wrote:
On Tue, Feb 10, 2026 at 08:09:08AM -0700, Keith Busch wrote:quoted
If you leave the queue quiesced, pending IO will form requests that are entered and waiting in the block layer. You can't freeze a queue with entered requests. We unquiesce first to flush any pending IO that had entered during the prior reset. It's not the best way to handle this situation. It would be smarter to steal the bio's from all the entered requests, then end those requests, then resubmit the bios after the hw queues are initialized. We don't do that because no one's really complained, probably because the queue counts don't usually change after a reset.FYI, Daniel Wagner had been thinking about doing this reinsert for something (I forgot what exactly), and this kind of reinserting from kblockd would also finally make REQ_NOWAIT practically useful for file system initiated writes. So I hope we can eventually get to it, and it should help to sort out various problems.
I took a moment to craft a test by modifying the poll_queues parameter at runtime, say from 1 -> 0, then start a controller reset. Turns out the driver is a bit broken here. A hipri job will poll a non-polled queue after the reset, causing a double completion with the now irq driven queue, and the entire blk-mq map is messed up, too. Oops!