diff options
| author | Jianan Huang <jnhuang95@gmail.com> | 2026-10-23 17:26:11 +0800 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2026-11-03 07:07:25 -0700 |
| commit | 3a9892bca4dd0182db61702e131cad569b1d71e6 (patch) | |
| tree | a800fb564156853b8bf9083592968ac4d530b8b5 /scripts/livepatch/init.c | |
| parent | 57cd1a08717690e5ea01d7ac7a96bb33a2dca117 (diff) | |
blk-mq: reset queue state on scheduler teardown
We observed I/O timeouts with requests stalled in per-CPU software
queues.
The affected queue had no elevator, but QUEUE_FLAG_SQ_SCHED remained
set. A failed elevator switch can leave this state when falling back to
none without clearing the flag. With empty hctx dispatch lists, a
queue-wide restart on CPU4 would skip requests pending in ctx5/ctx7:
CPU4: blk_mq_run_hw_queues(q)
sq_hctx = hctx4
hctx4: no pending requests -> selected
hctx5: 9 reads in ctx5 -> skipped
hctx7: 3 writes in ctx7 -> skipped
The pending requests may remain undispatched until another event runs
their hardware queues.
Clear the flag and restore nr_requests and async_depth to the driver
queue depth in the common scheduler teardown path, covering both
scheduler exit and failed initialization.
Fixes: 4d337cebcb1c ("blk-mq: avoid to touch q->elevator without any protection")
Assisted-by: LLM
Signed-off-by: Jianan Huang <jnhuang95@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://patch.msgid.link/20261023092611.116795-1-jnhuang95@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'scripts/livepatch/init.c')
0 files changed, 0 insertions, 0 deletions
