diff options
| author | Jens Axboe <[email protected]> | 2025-02-08 17:50:34 +0000 |
|---|---|---|
| committer | Jens Axboe <[email protected]> | 2025-02-17 12:34:46 +0000 |
| commit | 7c71a0af81ba72de9b2c501065e4e718aba9a271 (patch) | |
| tree | 26c23423a4f9d562d351b5f8fb3915fe2f2ffade /drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | |
| parent | io_uring/waitid: use generic io_cancel_remove() helper (diff) | |
| download | kernel-7c71a0af81ba72de9b2c501065e4e718aba9a271.tar.gz kernel-7c71a0af81ba72de9b2c501065e4e718aba9a271.zip | |
io_uring/net: improve recv bundles
Current recv bundles are only supported for multishot receives, and
additionally they also always post at least 2 CQEs if more data is
available than what a buffer will hold. This happens because the initial
bundle recv will do a single buffer, and then do the rest of what is in
the socket as a followup receive. As shown in a test program, if 1k
buffers are available and 32k is available to receive in the socket,
you'd get the following completions:
bundle=1, mshot=0
cqe res 1024
cqe res 1024
[...]
cqe res 1024
bundle=1, mshot=1
cqe res 1024
cqe res 31744
where bundle=1 && mshot=0 will post 32 1k completions, and bundle=1 &&
mshot=1 will post a 1k completion and then a 31k completion.
To support bundle recv without multishot, it's possible to simply retry
the recv immediately and post a single completion, rather than split it
into two completions. With the below patch, the same test looks as
follows:
bundle=1, mshot=0
cqe res 32768
bundle=1, mshot=1
cqe res 32768
where mshot=0 works fine for bundles, and both of them post just a
single 32k completion rather than split it into separate completions.
Posting fewer completions is always a nice win, and not needing
multishot for proper bundle efficiency is nice for cases that can't
necessarily use multishot.
Reported-by: Norman Maurer <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Fixes: 2f9c9515bdfd ("io_uring/net: support bundles for recv")
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c')
0 files changed, 0 insertions, 0 deletions
