Skip to contentSkip to conversation

io_uring: remove unneeded io_send_zc accounting

PATCH Applied Dylan Yudaken 3 participants 5 messages Feb 15 – Feb 16 io_uring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io_uring: remove unneeded io_send_zc accounting

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).

---
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(-)
io_uring/net.c +0 -2
index a6f3cbb7dfea..8576c6cb2236 100644
@@ -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

Signature · 1 line
2.50.1
#1 lore raw
Quoted 6 lines · 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).

Quoted 7 lines

---
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

Signature · 1 line
Pavel Begunkov
Reviewed-by
#2 lore raw
Quoted 11 lines · Pavel Begunkov
Quoted 10 lines · 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).

---
Hi,

Quoted 5 lines
Quoted 3 lines

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

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

Signature · 1 line
Pavel Begunkov
maintainer
#3 lore raw
In reply to Dylan Yudaken
Quoted 6 lines · 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).

Quoted 7 lines

---
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.

Signature · 1 line
Jens Axboe
maintainer Applied
#4 lore raw
In reply to Dylan Yudaken
Quoted 8 lines · 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).

[...]

Applied, thanks!

[1/1] io_uring: remove unneeded io_send_zc accounting

      commit: 046fcc83ac1ba8747f0bcae13f5e433802735245

Best regards,

Signature · 1 line
Jens Axboe