Re: [PATCH] blk-mq: run the hw queue synchronously for unplugged scheduler inserts

From: Qiliang Yuan

Date: Sat Nov 14 2026 - 21:27:34 EST


Hi Kaitao,

On Thu, Oct 29, 2026 at 09:09:19PM +0800, Kaitao Cheng wrote:
> Our customer ran fio tests with --bs=4K --rw=randwrite --iodepth=1 --numjobs=1
> and confirmed that adding bio plugging to __submit_bio() improves performance.
>
> Without bio plugging in __submit_bio():
> fio:
> __submit_bio (17.16%)
> → blk_mq_submit_bio (16.80%)
> → blk_mq_run_hw_queue (9.97%)
> → blk_mq_delay_run_hw_queue (9.41%)
> → kblockd_mod_delayed_work_on (9.13%)
[...]
> With bio plugging in __submit_bio():
> __submit_bio (26.94%)
> → __blk_flush_plug (21.36%)
> → blk_mq_flush_plug_list (21.24%)
> → blk_mq_flush_plug_list.part.0 (18.38%)
> → blk_mq_run_hw_queue (15.34%)
> → blk_mq_sched_dispatch_requests (14.55%)
[...]
> Adding bio plugging increased IOPS from 60,000 to 74,000 and reduced latency
> from 12.4 µs to 9.5 µs.

Thanks, this is the same pattern on NVMe with an I/O scheduler. Without
the plug every request is dispatched by kblockd, with it the submitter
dispatches the request itself through blk_mq_run_hw_queue(). This patch
leaves __submit_bio() unplugged and runs the queue from the submitter
for scheduler inserts, which should give the plugged profile without
the plug.

Could you run the same fio job on the unplugged kernel with this patch
applied? Ming asked earlier whether real devices see a difference, so a
Tested-by from an NVMe setup would help if it gets back to about 74K
IOPS.

Thanks,
Qiliang