Revision 3770a42bb8ceb856877699257a43c0585a5d2996 authored by Sagi Grimberg on 05 September 2022, 15:07:06 UTC, committed by Christoph Hellwig on 06 September 2022, 04:40:44 UTC
When we queue requests, we strive to batch as much as possible and also signal the network stack that more data is about to be sent over a socket with MSG_SENDPAGE_NOTLAST. This flag looks at the pending requests queued as well as queue->more_requests that is derived from the block layer last-in-batch indication. We set more_request=true when we flush the request directly from .queue_rq submission context (in nvme_tcp_send_all), however this is wrongly assuming that no other requests may be queued during the execution of nvme_tcp_send_all. Due to this, a race condition may happen where: 1. request X is queued as !last-in-batch 2. request X submission context calls nvme_tcp_send_all directly 3. nvme_tcp_send_all is preempted and schedules to a different cpu 4. request Y is queued as last-in-batch 5. nvme_tcp_send_all context sends request X+Y, however signals for both MSG_SENDPAGE_NOTLAST because queue->more_requests=true. ==> none of the requests is pushed down to the wire as the network stack is waiting for more data, both requests timeout. To fix this, we eliminate queue->more_requests and only rely on the queue req_list and send_list to be not-empty. Fixes: 122e5b9f3d37 ("nvme-tcp: optimize network stack with setting msg flags according to batch size") Reported-by: Jonathan Nicklin <jnicklin@blockbridge.com> Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Tested-by: Jonathan Nicklin <jnicklin@blockbridge.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent 160f354
File | Mode | Size |
---|---|---|
apparmor | ||
bpf | ||
integrity | ||
keys | ||
landlock | ||
loadpin | ||
lockdown | ||
safesetid | ||
selinux | ||
smack | ||
tomoyo | ||
yama | ||
Kconfig | -rw-r--r-- | 9.6 KB |
Kconfig.hardening | -rw-r--r-- | 13.9 KB |
Makefile | -rw-r--r-- | 892 bytes |
commoncap.c | -rw-r--r-- | 43.0 KB |
device_cgroup.c | -rw-r--r-- | 21.1 KB |
inode.c | -rw-r--r-- | 10.6 KB |
lsm_audit.c | -rw-r--r-- | 11.0 KB |
min_addr.c | -rw-r--r-- | 1.3 KB |
security.c | -rw-r--r-- | 66.6 KB |
Computing file changes ...