public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] io_uring: remove unneeded io_send_zc accounting
@ 2026-02-15 23:15 Dylan Yudaken
  2026-02-15 23:39 ` Pavel Begunkov
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Dylan Yudaken @ 2026-02-15 23:15 UTC (permalink / raw)
  To: axboe, io-uring, asml.silence; +Cc: Dylan Yudaken

zc->len and zc->buf are not actually used once you get to the retry
stage. The buffer remains in kmsg->msg.msg_iter, which is setup in
io_send_setup.
Note: it still seems needed in io_send due to io_send_select_buffer
needing it (for the len parameter).

Signed-off-by: Dylan Yudaken <dyudaken@gmail.com>
---
Hi,

I'm reasonably sure this is correct - but I think Pavel might want to
double check that I did not miss anything. The tests seem to pass with no
changes.

Thanks,
Dylan


 io_uring/net.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/io_uring/net.c b/io_uring/net.c
index a6f3cbb7dfea..8576c6cb2236 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -1493,8 +1493,6 @@ int io_send_zc(struct io_kiocb *req, unsigned int issue_flags)
 			return -EAGAIN;
 
 		if (ret > 0 && io_net_retry(sock, kmsg->msg.msg_flags)) {
-			zc->len -= ret;
-			zc->buf += ret;
 			zc->done_io += ret;
 			return -EAGAIN;
 		}

base-commit: 26a4cfaff82a2dcb810f6bfd5f4842f9b6046c8a
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] io_uring: remove unneeded io_send_zc accounting
  2026-02-15 23:15 [PATCH] io_uring: remove unneeded io_send_zc accounting Dylan Yudaken
@ 2026-02-15 23:39 ` Pavel Begunkov
  2026-02-16 11:43   ` Pavel Begunkov
  2026-02-15 23:51 ` Jens Axboe
  2026-02-16 15:29 ` Jens Axboe
  2 siblings, 1 reply; 5+ messages in thread
From: Pavel Begunkov @ 2026-02-15 23:39 UTC (permalink / raw)
  To: Dylan Yudaken, axboe, io-uring

On 2/15/26 23:15, Dylan Yudaken wrote:
> zc->len and zc->buf are not actually used once you get to the retry
> stage. The buffer remains in kmsg->msg.msg_iter, which is setup in
> io_send_setup.
> Note: it still seems needed in io_send due to io_send_select_buffer
> needing it (for the len parameter).
> 
> Signed-off-by: Dylan Yudaken <dyudaken@gmail.com>
> ---
> Hi,
> 
> I'm reasonably sure this is correct - but I think Pavel might want to
> double check that I did not miss anything. The tests seem to pass with no
> changes.

Looks good, I'll have a look tomorrow

-- 
Pavel Begunkov


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] io_uring: remove unneeded io_send_zc accounting
  2026-02-15 23:15 [PATCH] io_uring: remove unneeded io_send_zc accounting Dylan Yudaken
  2026-02-15 23:39 ` Pavel Begunkov
@ 2026-02-15 23:51 ` Jens Axboe
  2026-02-16 15:29 ` Jens Axboe
  2 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2026-02-15 23:51 UTC (permalink / raw)
  To: Dylan Yudaken, io-uring, asml.silence

On 2/15/26 4:15 PM, Dylan Yudaken wrote:
> zc->len and zc->buf are not actually used once you get to the retry
> stage. The buffer remains in kmsg->msg.msg_iter, which is setup in
> io_send_setup.
> Note: it still seems needed in io_send due to io_send_select_buffer
> needing it (for the len parameter).
> 
> Signed-off-by: Dylan Yudaken <dyudaken@gmail.com>
> ---
> Hi,
> 
> I'm reasonably sure this is correct - but I think Pavel might want to
> double check that I did not miss anything. The tests seem to pass with no
> changes.

FWIW looks good to me, and we should probably move towards just
tracking state in iov_iter for the other paths too and get rid of
this. Wild handwaving, haven't actually looked at it, but it'd be
a nice cleanup.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] io_uring: remove unneeded io_send_zc accounting
  2026-02-15 23:39 ` Pavel Begunkov
@ 2026-02-16 11:43   ` Pavel Begunkov
  0 siblings, 0 replies; 5+ messages in thread
From: Pavel Begunkov @ 2026-02-16 11:43 UTC (permalink / raw)
  To: Dylan Yudaken, axboe, io-uring

On 2/15/26 23:39, Pavel Begunkov wrote:
> On 2/15/26 23:15, Dylan Yudaken wrote:
>> zc->len and zc->buf are not actually used once you get to the retry
>> stage. The buffer remains in kmsg->msg.msg_iter, which is setup in
>> io_send_setup.
>> Note: it still seems needed in io_send due to io_send_select_buffer
>> needing it (for the len parameter).
>>
>> Signed-off-by: Dylan Yudaken <dyudaken@gmail.com>
>> ---
>> Hi,
>>
>> I'm reasonably sure this is correct - but I think Pavel might want to
>> double check that I did not miss anything. The tests seem to pass with no
>> changes.
> 
> Looks good, I'll have a look tomorrow

Reviewed-by: Pavel Begunkov <asml.silence@gmail.com>

I like the change, and we should get rid of duplication between
send and sendmsg on top.

-- 
Pavel Begunkov


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] io_uring: remove unneeded io_send_zc accounting
  2026-02-15 23:15 [PATCH] io_uring: remove unneeded io_send_zc accounting Dylan Yudaken
  2026-02-15 23:39 ` Pavel Begunkov
  2026-02-15 23:51 ` Jens Axboe
@ 2026-02-16 15:29 ` Jens Axboe
  2 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2026-02-16 15:29 UTC (permalink / raw)
  To: io-uring, asml.silence, Dylan Yudaken


On Sun, 15 Feb 2026 23:15:23 +0000, Dylan Yudaken wrote:
> zc->len and zc->buf are not actually used once you get to the retry
> stage. The buffer remains in kmsg->msg.msg_iter, which is setup in
> io_send_setup.
> Note: it still seems needed in io_send due to io_send_select_buffer
> needing it (for the len parameter).
> 
> 
> [...]

Applied, thanks!

[1/1] io_uring: remove unneeded io_send_zc accounting
      commit: 046fcc83ac1ba8747f0bcae13f5e433802735245

Best regards,
-- 
Jens Axboe




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-02-16 15:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-15 23:15 [PATCH] io_uring: remove unneeded io_send_zc accounting Dylan Yudaken
2026-02-15 23:39 ` Pavel Begunkov
2026-02-16 11:43   ` Pavel Begunkov
2026-02-15 23:51 ` Jens Axboe
2026-02-16 15:29 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox