[RFC PATCH 1/2] nvme-tcp: remove the direct send path
Seiji Nishikawa
snishika at redhat.com
Sat Nov 21 20:37:32 PST 2026
On Sun, Nov 22, 2026 at 10:49 AM <sashiko-bot at kernel.org> wrote:
> [Severity: Medium]
> Does removing the inline send from nvme_tcp_queue_request() break polled
> I/O on HCTX_TYPE_POLL queues?
[ ... ]
> For SCHED_NORMAL tasks on queue->io_cpu, waking
> the WQ_HIGHPRI worker sets TIF_NEED_RESCHED, causing blk_hctx_poll() and
> io_iopoll_check() to abort polling on need_resched() or forcing two
> context switches per polled I/O.
This is right. I ran the test with poll queues on the same two machines.
The host connects with --nr-poll-queues=4, and fio runs with io_uring and
--hipri, 4k random I/O at queue depth 1, on the io_cpu of a poll queue.
Average of 3 runs of 60 seconds, latency in usec, ctx is the number of
context switches of fio in one run:
IOPS slat clat lat ctx
randread base 5017 4.72 193.95 198.67 553
patched 4179 9.35 229.70 239.05 251,318
randwrite base 3619 5.60 269.94 275.54 542
patched 3621 10.62 264.53 275.16 217,806
For randread, lat goes up by 40 usec (20%) and IOPS goes down by 17%.
ctx shows why. Without the direct send path, fio is switched out for the
io_work kworker once per I/O. With it, fio stays on the CPU and keeps
polling. randwrite shows no difference.
So removing the direct send path costs about 20% for polled reads at
queue depth 1 on this setup. One way to avoid this is to keep the direct
send path only for poll queues. Poll queues then still have 2 senders,
so send_mutex stays and patch 2 goes away.
I will send a v2 that does this, unless the list prefers to remove the
direct send path for all queues and take this cost.
Thanks,
Seiji
More information about the Linux-nvme
mailing list