2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-13 07:07:23 -06:00
|
|
|
|
2022-07-07 14:30:09 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2022-07-12 21:52:43 +01:00
|
|
|
|
2022-07-12 21:52:46 +01:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 14:06:15 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-04 20:29:48 -06:00
|
|
|
|
2023-03-20 11:13:49 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2024-06-14 12:30:46 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-14 12:30:47 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-05 13:10:04 -07:00
|
|
|
|
2022-09-08 13:20:33 +01:00
|
|
|
|
2022-07-25 10:52:06 +01:00
|
|
|
|
2024-01-29 12:00:58 -07:00
|
|
|
|
2022-09-08 13:20:33 +01:00
|
|
|
|
2022-09-21 12:17:51 +01:00
|
|
|
|
2023-01-22 10:02:55 -07:00
|
|
|
|
2024-10-16 07:39:31 -06:00
|
|
|
|
2023-06-12 13:51:36 -06:00
|
|
|
|
2022-09-21 12:17:51 +01:00
|
|
|
|
2022-09-01 11:54:04 +01:00
|
|
|
|
2022-07-12 21:52:43 +01:00
|
|
|
|
|
|
|
|
|
2024-01-29 12:00:58 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-27 05:52:25 -08:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-27 05:52:25 -08:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-16 15:33:53 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-07 14:30:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-16 15:33:53 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-07 14:30:09 -06:00
|
|
|
|
2024-03-16 15:33:53 -06:00
|
|
|
|
2022-07-07 14:30:09 -06:00
|
|
|
|
|
|
|
|
|
2025-01-22 20:00:57 -07:00
|
|
|
|
2024-03-20 15:19:44 -06:00
|
|
|
|
2022-07-07 14:30:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-18 10:07:37 -06:00
|
|
|
|
2022-07-07 14:30:09 -06:00
|
|
|
|
|
|
|
|
|
2022-09-26 14:35:09 +01:00
|
|
|
|
2022-07-07 14:30:09 -06:00
|
|
|
|
2025-01-22 20:00:57 -07:00
|
|
|
|
2024-12-16 15:46:12 -05:00
|
|
|
|
|
|
|
|
|
2022-07-07 14:30:09 -06:00
|
|
|
|
2024-12-16 15:46:12 -05:00
|
|
|
|
2025-01-22 20:00:57 -07:00
|
|
|
|
2024-12-16 15:46:12 -05:00
|
|
|
|
|
|
|
|
|
2022-07-07 14:30:09 -06:00
|
|
|
|
|
|
|
|
|
2024-03-16 15:33:53 -06:00
|
|
|
|
2025-01-28 20:56:12 +00:00
|
|
|
|
2024-03-16 15:33:53 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-25 12:52:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-19 14:16:47 -07:00
|
|
|
|
2024-02-27 11:09:20 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-19 14:16:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-16 15:33:53 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-19 14:16:47 -07:00
|
|
|
|
2024-02-27 11:09:20 -07:00
|
|
|
|
2024-02-19 14:16:47 -07:00
|
|
|
|
|
|
|
|
|
2024-02-27 11:09:20 -07:00
|
|
|
|
2024-02-19 14:16:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-27 11:09:20 -07:00
|
|
|
|
2024-03-16 15:33:53 -06:00
|
|
|
|
|
|
|
|
|
2024-02-27 11:09:20 -07:00
|
|
|
|
2024-02-19 14:16:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-27 11:09:20 -07:00
|
|
|
|
2024-03-16 15:33:53 -06:00
|
|
|
|
2024-02-19 14:16:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-28 20:56:12 +00:00
|
|
|
|
|
|
|
|
|
2024-02-19 14:16:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-27 11:09:20 -07:00
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2024-10-22 15:43:15 +01:00
|
|
|
|
2024-03-16 15:33:53 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2024-10-22 15:43:15 +01:00
|
|
|
|
2024-02-19 14:16:47 -07:00
|
|
|
|
|
|
|
|
|
2024-02-26 16:43:01 -07:00
|
|
|
|
2024-10-22 15:43:15 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-26 16:43:01 -07:00
|
|
|
|
|
|
|
|
|
2024-02-19 14:16:47 -07:00
|
|
|
|
2024-02-27 11:09:20 -07:00
|
|
|
|
2024-03-16 15:33:53 -06:00
|
|
|
|
|
|
|
|
|
2024-02-27 11:09:20 -07:00
|
|
|
|
2024-02-26 16:43:01 -07:00
|
|
|
|
|
|
|
|
|
2024-02-19 14:16:47 -07:00
|
|
|
|
2025-01-28 20:56:13 +00:00
|
|
|
|
|
|
|
|
|
2024-02-26 16:43:01 -07:00
|
|
|
|
2025-01-28 20:56:13 +00:00
|
|
|
|
2024-02-26 16:43:01 -07:00
|
|
|
|
2025-01-28 20:56:13 +00:00
|
|
|
|
2024-03-16 15:33:53 -06:00
|
|
|
|
2024-02-19 14:16:47 -07:00
|
|
|
|
2024-02-26 16:43:01 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-19 14:16:47 -07:00
|
|
|
|
|
|
|
|
|
2024-02-26 16:43:01 -07:00
|
|
|
|
2024-03-16 15:33:53 -06:00
|
|
|
|
|
|
|
|
|
2024-02-19 14:16:47 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-28 20:56:12 +00:00
|
|
|
|
|
|
|
|
|
2024-02-19 14:16:47 -07:00
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2024-02-27 11:09:20 -07:00
|
|
|
|
2023-06-12 13:51:36 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2024-02-27 11:09:20 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-02-25 15:59:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-27 11:09:20 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-19 14:16:47 -07:00
|
|
|
|
|
|
|
|
|
2024-02-27 11:09:20 -07:00
|
|
|
|
|
|
|
|
|
2023-06-12 13:51:36 -06:00
|
|
|
|
2023-06-20 16:11:51 -06:00
|
|
|
|
2023-06-12 13:51:36 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-16 15:33:53 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2024-10-22 15:43:13 +01:00
|
|
|
|
2024-03-18 08:09:47 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-22 15:43:13 +01:00
|
|
|
|
|
|
|
|
|
2024-03-18 08:09:47 -06:00
|
|
|
|
|
|
|
|
|
2024-10-22 15:43:14 +01:00
|
|
|
|
|
|
|
|
|
2024-10-22 15:43:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-18 08:09:47 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-22 15:43:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-18 08:09:47 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-22 15:43:13 +01:00
|
|
|
|
2024-03-18 08:09:47 -06:00
|
|
|
|
io_uring/net: add provided buffer support for IORING_OP_SEND
It's pretty trivial to wire up provided buffer support for the send
side, just like how it's done the receive side. This enables setting up
a buffer ring that an application can use to push pending sends to,
and then have a send pick a buffer from that ring.
One of the challenges with async IO and networking sends is that you
can get into reordering conditions if you have more than one inflight
at the same time. Consider the following scenario where everything is
fine:
1) App queues sendA for socket1
2) App queues sendB for socket1
3) App does io_uring_submit()
4) sendA is issued, completes successfully, posts CQE
5) sendB is issued, completes successfully, posts CQE
All is fine. Requests are always issued in-order, and both complete
inline as most sends do.
However, if we're flooding socket1 with sends, the following could
also result from the same sequence:
1) App queues sendA for socket1
2) App queues sendB for socket1
3) App does io_uring_submit()
4) sendA is issued, socket1 is full, poll is armed for retry
5) Space frees up in socket1, this triggers sendA retry via task_work
6) sendB is issued, completes successfully, posts CQE
7) sendA is retried, completes successfully, posts CQE
Now we've sent sendB before sendA, which can make things unhappy. If
both sendA and sendB had been using provided buffers, then it would look
as follows instead:
1) App queues dataA for sendA, queues sendA for socket1
2) App queues dataB for sendB queues sendB for socket1
3) App does io_uring_submit()
4) sendA is issued, socket1 is full, poll is armed for retry
5) Space frees up in socket1, this triggers sendA retry via task_work
6) sendB is issued, picks first buffer (dataA), completes successfully,
posts CQE (which says "I sent dataA")
7) sendA is retried, picks first buffer (dataB), completes successfully,
posts CQE (which says "I sent dataB")
Now we've sent the data in order, and everybody is happy.
It's worth noting that this also opens the door for supporting multishot
sends, as provided buffers would be a prerequisite for that. Those can
trigger either when new buffers are added to the outgoing ring, or (if
stalled due to lack of space) when space frees up in the socket.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-02-19 10:46:44 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-18 08:09:47 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-22 15:43:14 +01:00
|
|
|
|
2024-03-18 08:09:47 -06:00
|
|
|
|
2024-10-22 15:43:14 +01:00
|
|
|
|
2024-10-22 15:43:12 +01:00
|
|
|
|
2024-03-18 08:09:47 -06:00
|
|
|
|
|
|
|
|
|
2024-10-22 15:43:14 +01:00
|
|
|
|
|
|
|
|
|
2024-03-18 08:09:47 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-05 13:10:04 -07:00
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2024-03-07 12:43:22 -07:00
|
|
|
|
|
|
|
|
|
2024-10-22 15:43:13 +01:00
|
|
|
|
|
|
|
|
|
2022-09-21 12:17:51 +01:00
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-05 13:10:04 -07:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-05 13:10:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-22 15:43:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-22 15:43:13 +01:00
|
|
|
|
2024-10-22 15:43:14 +01:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2024-03-06 07:57:57 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-05 13:10:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-27 08:26:07 -06:00
|
|
|
|
2024-03-05 13:10:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-27 08:26:07 -06:00
|
|
|
|
2024-03-05 13:10:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2024-03-18 08:09:47 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
io_uring/net: always setup an io_async_msghdr
Rather than use an on-stack one and then need to allocate and copy if
async execution is required, always grab one upfront. This should be
very cheap, and potentially even have cache hotness benefits for
back-to-back send/recv requests.
For any recv type of request, this is probably a good choice in general,
as it's expected that no data is available initially. For send this is
not necessarily the case, as space in the socket buffer is expected to
be available. However, getting a cached io_async_msghdr is very cheap,
and as it should be cache hot, probably the difference here is neglible,
if any.
A nice side benefit is that io_setup_async_msg can get killed
completely, which has some nasty iovec manipulation code.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-03-16 17:26:09 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-12 12:39:54 -06:00
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
io_uring/net: always setup an io_async_msghdr
Rather than use an on-stack one and then need to allocate and copy if
async execution is required, always grab one upfront. This should be
very cheap, and potentially even have cache hotness benefits for
back-to-back send/recv requests.
For any recv type of request, this is probably a good choice in general,
as it's expected that no data is available initially. For send this is
not necessarily the case, as space in the socket buffer is expected to
be available. However, getting a cached io_async_msghdr is very cheap,
and as it should be cache hot, probably the difference here is neglible,
if any.
A nice side benefit is that io_setup_async_msg can get killed
completely, which has some nasty iovec manipulation code.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-03-16 17:26:09 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2023-06-19 09:35:34 -06:00
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2024-03-07 12:53:24 -07:00
|
|
|
|
io_uring/net: always setup an io_async_msghdr
Rather than use an on-stack one and then need to allocate and copy if
async execution is required, always grab one upfront. This should be
very cheap, and potentially even have cache hotness benefits for
back-to-back send/recv requests.
For any recv type of request, this is probably a good choice in general,
as it's expected that no data is available initially. For send this is
not necessarily the case, as space in the socket buffer is expected to
be available. However, getting a cached io_async_msghdr is very cheap,
and as it should be cache hot, probably the difference here is neglible,
if any.
A nice side benefit is that io_setup_async_msg can get killed
completely, which has some nasty iovec manipulation code.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-03-16 17:26:09 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2022-09-08 13:20:29 +01:00
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2024-03-18 13:52:42 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-28 20:56:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2024-03-18 08:09:47 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-18 08:09:47 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-05 13:10:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-28 20:56:14 +00:00
|
|
|
|
|
|
|
|
|
2024-03-05 13:10:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-05 09:34:21 -07:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2023-05-22 13:11:10 +01:00
|
|
|
|
2024-03-05 09:34:21 -07:00
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
io_uring/net: always setup an io_async_msghdr
Rather than use an on-stack one and then need to allocate and copy if
async execution is required, always grab one upfront. This should be
very cheap, and potentially even have cache hotness benefits for
back-to-back send/recv requests.
For any recv type of request, this is probably a good choice in general,
as it's expected that no data is available initially. For send this is
not necessarily the case, as space in the socket buffer is expected to
be available. However, getting a cached io_async_msghdr is very cheap,
and as it should be cache hot, probably the difference here is neglible,
if any.
A nice side benefit is that io_setup_async_msg can get killed
completely, which has some nasty iovec manipulation code.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-03-16 17:26:09 -06:00
|
|
|
|
2022-09-21 12:17:51 +01:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-07 12:53:24 -07:00
|
|
|
|
io_uring/net: always setup an io_async_msghdr
Rather than use an on-stack one and then need to allocate and copy if
async execution is required, always grab one upfront. This should be
very cheap, and potentially even have cache hotness benefits for
back-to-back send/recv requests.
For any recv type of request, this is probably a good choice in general,
as it's expected that no data is available initially. For send this is
not necessarily the case, as space in the socket buffer is expected to
be available. However, getting a cached io_async_msghdr is very cheap,
and as it should be cache hot, probably the difference here is neglible,
if any.
A nice side benefit is that io_setup_async_msg can get killed
completely, which has some nasty iovec manipulation code.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-03-16 17:26:09 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2022-09-08 13:20:29 +01:00
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-05 13:10:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-18 13:52:42 -06:00
|
|
|
|
2024-03-05 13:10:04 -07:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2024-02-27 11:09:20 -07:00
|
|
|
|
|
|
|
|
|
2024-03-01 19:43:48 +05:00
|
|
|
|
2022-07-14 04:02:58 -07:00
|
|
|
|
2024-02-27 11:09:20 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-14 04:02:58 -07:00
|
|
|
|
2024-02-27 11:09:20 -07:00
|
|
|
|
|
|
|
|
|
2024-03-01 18:29:39 +03:00
|
|
|
|
2024-02-27 11:09:20 -07:00
|
|
|
|
|
|
|
|
|
2024-03-01 18:29:39 +03:00
|
|
|
|
2024-02-27 11:09:20 -07:00
|
|
|
|
2022-07-14 04:02:58 -07:00
|
|
|
|
2024-02-27 11:09:20 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-27 11:09:20 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2023-09-14 16:51:09 +01:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2024-02-27 11:09:20 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2024-02-27 11:09:20 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2024-03-18 07:36:03 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2024-03-15 16:36:23 -06:00
|
|
|
|
2024-03-18 07:36:03 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2024-03-18 10:07:37 -06:00
|
|
|
|
2024-03-18 07:36:03 -06:00
|
|
|
|
2022-09-08 13:20:30 +01:00
|
|
|
|
2024-03-18 07:36:03 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-02 16:32:51 -07:00
|
|
|
|
2024-03-18 07:36:03 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-05 16:22:04 -07:00
|
|
|
|
|
|
|
|
|
2022-06-30 02:12:29 -07:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2024-03-07 12:43:22 -07:00
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-05 16:22:04 -07:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2023-02-24 16:01:24 +01:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-05 16:22:04 -07:00
|
|
|
|
2023-01-22 10:02:55 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-05 16:22:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-30 02:12:29 -07:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-29 12:00:58 -07:00
|
|
|
|
2024-03-18 07:36:03 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2022-06-30 02:12:29 -07:00
|
|
|
|
2022-07-14 04:02:58 -07:00
|
|
|
|
2022-06-30 02:12:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-14 04:02:58 -07:00
|
|
|
|
2024-03-05 15:39:16 -07:00
|
|
|
|
|
|
|
|
|
2022-06-30 02:12:29 -07:00
|
|
|
|
2024-03-05 16:22:04 -07:00
|
|
|
|
2024-07-02 09:16:46 -06:00
|
|
|
|
2024-03-05 16:22:04 -07:00
|
|
|
|
2024-03-05 15:39:16 -07:00
|
|
|
|
2023-05-17 12:20:44 -06:00
|
|
|
|
|
|
|
|
|
2024-07-02 09:16:46 -06:00
|
|
|
|
2024-08-27 08:26:07 -06:00
|
|
|
|
2024-07-02 09:16:46 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-27 08:26:07 -06:00
|
|
|
|
2024-07-02 09:16:46 -06:00
|
|
|
|
2024-03-05 16:22:04 -07:00
|
|
|
|
2024-01-29 11:54:18 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-08 13:55:58 +00:00
|
|
|
|
2024-03-18 22:00:31 +00:00
|
|
|
|
2024-01-29 12:00:58 -07:00
|
|
|
|
|
|
|
|
|
2024-02-25 12:52:39 -07:00
|
|
|
|
2024-01-29 11:54:18 -07:00
|
|
|
|
2024-03-05 15:39:16 -07:00
|
|
|
|
2024-01-29 12:00:58 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
io_uring/net: always setup an io_async_msghdr
Rather than use an on-stack one and then need to allocate and copy if
async execution is required, always grab one upfront. This should be
very cheap, and potentially even have cache hotness benefits for
back-to-back send/recv requests.
For any recv type of request, this is probably a good choice in general,
as it's expected that no data is available initially. For send this is
not necessarily the case, as space in the socket buffer is expected to
be available. However, getting a cached io_async_msghdr is very cheap,
and as it should be cache hot, probably the difference here is neglible,
if any.
A nice side benefit is that io_setup_async_msg can get killed
completely, which has some nasty iovec manipulation code.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-03-16 17:26:09 -06:00
|
|
|
|
2024-01-29 12:00:58 -07:00
|
|
|
|
io_uring/net: always setup an io_async_msghdr
Rather than use an on-stack one and then need to allocate and copy if
async execution is required, always grab one upfront. This should be
very cheap, and potentially even have cache hotness benefits for
back-to-back send/recv requests.
For any recv type of request, this is probably a good choice in general,
as it's expected that no data is available initially. For send this is
not necessarily the case, as space in the socket buffer is expected to
be available. However, getting a cached io_async_msghdr is very cheap,
and as it should be cache hot, probably the difference here is neglible,
if any.
A nice side benefit is that io_setup_async_msg can get killed
completely, which has some nasty iovec manipulation code.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-03-16 17:26:09 -06:00
|
|
|
|
|
|
|
|
|
2024-01-29 11:54:18 -07:00
|
|
|
|
|
|
|
|
|
2024-03-08 13:55:58 +00:00
|
|
|
|
|
|
|
|
|
2024-03-05 16:22:04 -07:00
|
|
|
|
2022-06-30 02:12:29 -07:00
|
|
|
|
|
|
|
|
|
2022-11-17 18:40:17 +00:00
|
|
|
|
2022-06-30 02:12:29 -07:00
|
|
|
|
2022-07-08 11:18:35 -07:00
|
|
|
|
|
|
|
|
|
2024-03-18 13:52:42 -06:00
|
|
|
|
2022-06-30 02:12:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-14 04:02:58 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-05 04:54:50 -07:00
|
|
|
|
2022-07-14 04:02:58 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-05 04:54:50 -07:00
|
|
|
|
2022-07-14 04:02:58 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2024-03-18 07:36:03 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-14 04:02:58 -07:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
io_uring/net: always setup an io_async_msghdr
Rather than use an on-stack one and then need to allocate and copy if
async execution is required, always grab one upfront. This should be
very cheap, and potentially even have cache hotness benefits for
back-to-back send/recv requests.
For any recv type of request, this is probably a good choice in general,
as it's expected that no data is available initially. For send this is
not necessarily the case, as space in the socket buffer is expected to
be available. However, getting a cached io_async_msghdr is very cheap,
and as it should be cache hot, probably the difference here is neglible,
if any.
A nice side benefit is that io_setup_async_msg can get killed
completely, which has some nasty iovec manipulation code.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-03-16 17:26:09 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2024-02-25 12:59:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-12-07 03:53:31 +00:00
|
|
|
|
2022-07-14 04:02:58 -07:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2022-07-14 04:02:58 -07:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2022-07-14 04:02:58 -07:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2022-07-14 04:02:58 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-05 11:07:31 -08:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-27 12:05:01 -06:00
|
|
|
|
2023-06-19 09:41:05 -06:00
|
|
|
|
2022-07-14 04:02:58 -07:00
|
|
|
|
|
|
|
|
|
2023-06-19 09:41:05 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-14 04:02:58 -07:00
|
|
|
|
|
|
|
|
|
2023-06-19 09:41:05 -06:00
|
|
|
|
2022-07-14 04:02:58 -07:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2022-07-14 04:02:58 -07:00
|
|
|
|
io_uring/net: always setup an io_async_msghdr
Rather than use an on-stack one and then need to allocate and copy if
async execution is required, always grab one upfront. This should be
very cheap, and potentially even have cache hotness benefits for
back-to-back send/recv requests.
For any recv type of request, this is probably a good choice in general,
as it's expected that no data is available initially. For send this is
not necessarily the case, as space in the socket buffer is expected to
be available. However, getting a cached io_async_msghdr is very cheap,
and as it should be cache hot, probably the difference here is neglible,
if any.
A nice side benefit is that io_setup_async_msg can get killed
completely, which has some nasty iovec manipulation code.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-03-16 17:26:09 -06:00
|
|
|
|
2022-07-14 04:02:58 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
io_uring/net: always setup an io_async_msghdr
Rather than use an on-stack one and then need to allocate and copy if
async execution is required, always grab one upfront. This should be
very cheap, and potentially even have cache hotness benefits for
back-to-back send/recv requests.
For any recv type of request, this is probably a good choice in general,
as it's expected that no data is available initially. For send this is
not necessarily the case, as space in the socket buffer is expected to
be available. However, getting a cached io_async_msghdr is very cheap,
and as it should be cache hot, probably the difference here is neglible,
if any.
A nice side benefit is that io_setup_async_msg can get killed
completely, which has some nasty iovec manipulation code.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-03-16 17:26:09 -06:00
|
|
|
|
2022-07-14 04:02:58 -07:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2024-03-07 12:53:24 -07:00
|
|
|
|
io_uring/net: always setup an io_async_msghdr
Rather than use an on-stack one and then need to allocate and copy if
async execution is required, always grab one upfront. This should be
very cheap, and potentially even have cache hotness benefits for
back-to-back send/recv requests.
For any recv type of request, this is probably a good choice in general,
as it's expected that no data is available initially. For send this is
not necessarily the case, as space in the socket buffer is expected to
be available. However, getting a cached io_async_msghdr is very cheap,
and as it should be cache hot, probably the difference here is neglible,
if any.
A nice side benefit is that io_setup_async_msg can get killed
completely, which has some nasty iovec manipulation code.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-03-16 17:26:09 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2022-09-08 13:20:29 +01:00
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-30 02:12:23 -07:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-30 02:12:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-05 15:39:16 -07:00
|
|
|
|
2022-07-14 04:02:58 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2024-03-05 16:22:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-07 15:06:45 -06:00
|
|
|
|
2024-03-05 16:22:04 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2024-03-18 07:36:03 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-30 02:12:29 -07:00
|
|
|
|
2024-09-26 07:08:10 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
io_uring/net: always setup an io_async_msghdr
Rather than use an on-stack one and then need to allocate and copy if
async execution is required, always grab one upfront. This should be
very cheap, and potentially even have cache hotness benefits for
back-to-back send/recv requests.
For any recv type of request, this is probably a good choice in general,
as it's expected that no data is available initially. For send this is
not necessarily the case, as space in the socket buffer is expected to
be available. However, getting a cached io_async_msghdr is very cheap,
and as it should be cache hot, probably the difference here is neglible,
if any.
A nice side benefit is that io_setup_async_msg can get killed
completely, which has some nasty iovec manipulation code.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-03-16 17:26:09 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-25 12:59:05 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-30 02:12:29 -07:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2024-03-05 16:22:04 -07:00
|
|
|
|
2024-07-02 09:37:30 -06:00
|
|
|
|
|
|
|
|
|
2024-03-05 15:39:16 -07:00
|
|
|
|
2024-07-02 09:37:30 -06:00
|
|
|
|
2024-03-05 16:22:04 -07:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2024-07-02 09:37:30 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2024-03-05 15:39:16 -07:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2024-03-05 15:39:16 -07:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2022-06-30 02:12:29 -07:00
|
|
|
|
io_uring/net: always setup an io_async_msghdr
Rather than use an on-stack one and then need to allocate and copy if
async execution is required, always grab one upfront. This should be
very cheap, and potentially even have cache hotness benefits for
back-to-back send/recv requests.
For any recv type of request, this is probably a good choice in general,
as it's expected that no data is available initially. For send this is
not necessarily the case, as space in the socket buffer is expected to
be available. However, getting a cached io_async_msghdr is very cheap,
and as it should be cache hot, probably the difference here is neglible,
if any.
A nice side benefit is that io_setup_async_msg can get killed
completely, which has some nasty iovec manipulation code.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-03-16 17:26:09 -06:00
|
|
|
|
2022-06-30 02:12:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2022-06-30 02:12:29 -07:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-07 12:53:24 -07:00
|
|
|
|
io_uring/net: always setup an io_async_msghdr
Rather than use an on-stack one and then need to allocate and copy if
async execution is required, always grab one upfront. This should be
very cheap, and potentially even have cache hotness benefits for
back-to-back send/recv requests.
For any recv type of request, this is probably a good choice in general,
as it's expected that no data is available initially. For send this is
not necessarily the case, as space in the socket buffer is expected to
be available. However, getting a cached io_async_msghdr is very cheap,
and as it should be cache hot, probably the difference here is neglible,
if any.
A nice side benefit is that io_setup_async_msg can get killed
completely, which has some nasty iovec manipulation code.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-03-16 17:26:09 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2022-09-08 13:20:29 +01:00
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2024-03-05 15:39:16 -07:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-26 07:08:10 -06:00
|
|
|
|
2022-06-30 02:12:23 -07:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-30 02:12:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-26 07:08:10 -06:00
|
|
|
|
2022-06-30 02:12:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2022-09-21 12:17:52 +01:00
|
|
|
|
2022-09-01 11:54:04 +01:00
|
|
|
|
2022-09-08 13:20:34 +01:00
|
|
|
|
2024-03-16 15:33:53 -06:00
|
|
|
|
2022-09-01 11:54:04 +01:00
|
|
|
|
2024-03-16 15:33:53 -06:00
|
|
|
|
|
|
|
|
|
2022-09-23 16:23:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-01 11:54:04 +01:00
|
|
|
|
|
|
|
|
|
2022-11-04 10:59:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-21 12:17:52 +01:00
|
|
|
|
2022-07-12 21:52:43 +01:00
|
|
|
|
2022-09-08 13:20:34 +01:00
|
|
|
|
2022-07-12 21:52:46 +01:00
|
|
|
|
2022-09-01 11:54:04 +01:00
|
|
|
|
2022-07-12 21:52:43 +01:00
|
|
|
|
2024-03-07 12:43:22 -07:00
|
|
|
|
2024-04-30 16:42:30 +01:00
|
|
|
|
2024-03-07 12:43:22 -07:00
|
|
|
|
2022-09-21 12:17:54 +01:00
|
|
|
|
2022-09-01 11:54:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-12 21:52:43 +01:00
|
|
|
|
|
|
|
|
|
2022-09-01 11:54:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-04 10:59:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-08 00:54:56 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-04 10:59:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-22 15:43:13 +01:00
|
|
|
|
2022-09-21 12:17:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-12 21:52:43 +01:00
|
|
|
|
2024-04-08 00:54:57 +01:00
|
|
|
|
2024-10-16 07:39:31 -06:00
|
|
|
|
2022-07-12 21:52:43 +01:00
|
|
|
|
|
|
|
|
|
2022-07-12 21:52:45 +01:00
|
|
|
|
2022-07-12 21:52:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-22 15:43:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-22 15:43:13 +01:00
|
|
|
|
2024-10-22 15:43:14 +01:00
|
|
|
|
2022-07-12 21:52:43 +01:00
|
|
|
|
|
|
|
|
|
2024-06-27 13:59:44 +01:00
|
|
|
|
2022-09-08 13:20:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-27 13:59:44 +01:00
|
|
|
|
2022-09-08 13:20:32 +01:00
|
|
|
|
|
|
|
|
|
2024-06-27 13:59:44 +01:00
|
|
|
|
2022-07-12 21:52:50 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-08 13:20:32 +01:00
|
|
|
|
2022-07-12 21:52:50 +01:00
|
|
|
|
2022-09-08 13:20:32 +01:00
|
|
|
|
2024-06-27 13:59:44 +01:00
|
|
|
|
2022-07-12 21:52:50 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-26 17:15:47 +01:00
|
|
|
|
2022-07-12 21:52:50 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-16 07:39:31 -06:00
|
|
|
|
2024-03-05 09:34:21 -07:00
|
|
|
|
|
|
|
|
|
2024-10-16 07:39:31 -06:00
|
|
|
|
2024-03-05 09:34:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-16 07:39:31 -06:00
|
|
|
|
io_uring/rsrc: get rid of per-ring io_rsrc_node list
Work in progress, but get rid of the per-ring serialization of resource
nodes, like registered buffers and files. Main issue here is that one
node can otherwise hold up a bunch of other nodes from getting freed,
which is especially a problem for file resource nodes and networked
workloads where some descriptors may not see activity in a long time.
As an example, instantiate an io_uring ring fd and create a sparse
registered file table. Even 2 will do. Then create a socket and register
it as fixed file 0, F0. The number of open files in the app is now 5,
with 0/1/2 being the usual stdin/out/err, 3 being the ring fd, and 4
being the socket. Register this socket (eg "the listener") in slot 0 of
the registered file table. Now add an operation on the socket that uses
slot 0. Finally, loop N times, where each loop creates a new socket,
registers said socket as a file, then unregisters the socket, and
finally closes the socket. This is roughly similar to what a basic
accept loop would look like.
At the end of this loop, it's not unreasonable to expect that there
would still be 5 open files. Each socket created and registered in the
loop is also unregistered and closed. But since the listener socket
registered first still has references to its resource node due to still
being active, each subsequent socket unregistration is stuck behind it
for reclaim. Hence 5 + N files are still open at that point, where N is
awaiting the final put held up by the listener socket.
Rewrite the io_rsrc_node handling to NOT rely on serialization. Struct
io_kiocb now gets explicit resource nodes assigned, with each holding a
reference to the parent node. A parent node is either of type FILE or
BUFFER, which are the two types of nodes that exist. A request can have
two nodes assigned, if it's using both registered files and buffers.
Since request issue and task_work completion is both under the ring
private lock, no atomics are needed to handle these references. It's a
simple unlocked inc/dec. As before, the registered buffer or file table
each hold a reference as well to the registered nodes. Final put of the
node will remove the node and free the underlying resource, eg unmap the
buffer or put the file.
Outside of removing the stall in resource reclaim described above, it
has the following advantages:
1) It's a lot simpler than the previous scheme, and easier to follow.
No need to specific quiesce handling anymore.
2) There are no resource node allocations in the fast path, all of that
happens at resource registration time.
3) The structs related to resource handling can all get simplified
quite a bit, like io_rsrc_node and io_rsrc_data. io_rsrc_put can
go away completely.
4) Handling of resource tags is much simpler, and doesn't require
persistent storage as it can simply get assigned up front at
registration time. Just copy them in one-by-one at registration time
and assign to the resource node.
The only real downside is that a request is now explicitly limited to
pinning 2 resources, one file and one buffer, where before just
assigning a resource node to a request would pin all of them. The upside
is that it's easier to follow now, as an individual resource is
explicitly referenced and assigned to the request.
With this in place, the above mentioned example will be using exactly 5
files at the end of the loop, not N.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-10-25 19:27:39 -06:00
|
|
|
|
2024-10-16 07:39:31 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-27 09:08:31 -06:00
|
|
|
|
|
|
|
|
|
2024-11-07 19:01:36 +08:00
|
|
|
|
2024-10-16 07:39:31 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
io_uring/rsrc: get rid of per-ring io_rsrc_node list
Work in progress, but get rid of the per-ring serialization of resource
nodes, like registered buffers and files. Main issue here is that one
node can otherwise hold up a bunch of other nodes from getting freed,
which is especially a problem for file resource nodes and networked
workloads where some descriptors may not see activity in a long time.
As an example, instantiate an io_uring ring fd and create a sparse
registered file table. Even 2 will do. Then create a socket and register
it as fixed file 0, F0. The number of open files in the app is now 5,
with 0/1/2 being the usual stdin/out/err, 3 being the ring fd, and 4
being the socket. Register this socket (eg "the listener") in slot 0 of
the registered file table. Now add an operation on the socket that uses
slot 0. Finally, loop N times, where each loop creates a new socket,
registers said socket as a file, then unregisters the socket, and
finally closes the socket. This is roughly similar to what a basic
accept loop would look like.
At the end of this loop, it's not unreasonable to expect that there
would still be 5 open files. Each socket created and registered in the
loop is also unregistered and closed. But since the listener socket
registered first still has references to its resource node due to still
being active, each subsequent socket unregistration is stuck behind it
for reclaim. Hence 5 + N files are still open at that point, where N is
awaiting the final put held up by the listener socket.
Rewrite the io_rsrc_node handling to NOT rely on serialization. Struct
io_kiocb now gets explicit resource nodes assigned, with each holding a
reference to the parent node. A parent node is either of type FILE or
BUFFER, which are the two types of nodes that exist. A request can have
two nodes assigned, if it's using both registered files and buffers.
Since request issue and task_work completion is both under the ring
private lock, no atomics are needed to handle these references. It's a
simple unlocked inc/dec. As before, the registered buffer or file table
each hold a reference as well to the registered nodes. Final put of the
node will remove the node and free the underlying resource, eg unmap the
buffer or put the file.
Outside of removing the stall in resource reclaim described above, it
has the following advantages:
1) It's a lot simpler than the previous scheme, and easier to follow.
No need to specific quiesce handling anymore.
2) There are no resource node allocations in the fast path, all of that
happens at resource registration time.
3) The structs related to resource handling can all get simplified
quite a bit, like io_rsrc_node and io_rsrc_data. io_rsrc_put can
go away completely.
4) Handling of resource tags is much simpler, and doesn't require
persistent storage as it can simply get assigned up front at
registration time. Just copy them in one-by-one at registration time
and assign to the resource node.
The only real downside is that a request is now explicitly limited to
pinning 2 resources, one file and one buffer, where before just
assigning a resource node to a request would pin all of them. The upside
is that it's easier to follow now, as an individual resource is
explicitly referenced and assigned to the request.
With this in place, the above mentioned example will be using exactly 5
files at the end of the loop, not N.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-10-25 19:27:39 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-05 09:34:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-21 12:17:52 +01:00
|
|
|
|
2022-07-12 21:52:43 +01:00
|
|
|
|
2022-09-08 13:20:34 +01:00
|
|
|
|
2024-03-18 08:09:47 -06:00
|
|
|
|
2022-07-12 21:52:43 +01:00
|
|
|
|
2022-09-28 00:51:49 +01:00
|
|
|
|
2022-07-12 21:52:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-21 11:16:40 +01:00
|
|
|
|
|
|
|
|
|
2022-07-12 21:52:43 +01:00
|
|
|
|
2024-03-18 08:09:47 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-12 21:52:43 +01:00
|
|
|
|
2024-03-05 09:34:21 -07:00
|
|
|
|
2024-10-16 07:39:31 -06:00
|
|
|
|
2022-07-12 21:52:46 +01:00
|
|
|
|
2022-08-24 13:07:40 +01:00
|
|
|
|
2022-07-12 21:52:46 +01:00
|
|
|
|
2022-07-12 21:52:43 +01:00
|
|
|
|
2024-04-08 00:54:57 +01:00
|
|
|
|
2022-07-12 21:52:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-05 09:34:21 -07:00
|
|
|
|
2023-05-22 13:11:10 +01:00
|
|
|
|
2022-07-12 21:52:43 +01:00
|
|
|
|
2024-03-05 09:34:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-12 21:52:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
io_uring/net: always setup an io_async_msghdr
Rather than use an on-stack one and then need to allocate and copy if
async execution is required, always grab one upfront. This should be
very cheap, and potentially even have cache hotness benefits for
back-to-back send/recv requests.
For any recv type of request, this is probably a good choice in general,
as it's expected that no data is available initially. For send this is
not necessarily the case, as space in the socket buffer is expected to
be available. However, getting a cached io_async_msghdr is very cheap,
and as it should be cache hot, probably the difference here is neglible,
if any.
A nice side benefit is that io_setup_async_msg can get killed
completely, which has some nasty iovec manipulation code.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-03-16 17:26:09 -06:00
|
|
|
|
2022-08-24 13:07:43 +01:00
|
|
|
|
2024-03-05 09:34:21 -07:00
|
|
|
|
2022-08-04 15:15:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-07 12:53:24 -07:00
|
|
|
|
io_uring/net: always setup an io_async_msghdr
Rather than use an on-stack one and then need to allocate and copy if
async execution is required, always grab one upfront. This should be
very cheap, and potentially even have cache hotness benefits for
back-to-back send/recv requests.
For any recv type of request, this is probably a good choice in general,
as it's expected that no data is available initially. For send this is
not necessarily the case, as space in the socket buffer is expected to
be available. However, getting a cached io_async_msghdr is very cheap,
and as it should be cache hot, probably the difference here is neglible,
if any.
A nice side benefit is that io_setup_async_msg can get killed
completely, which has some nasty iovec manipulation code.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-03-16 17:26:09 -06:00
|
|
|
|
2022-08-04 15:15:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-24 13:07:39 +01:00
|
|
|
|
2022-07-12 21:52:43 +01:00
|
|
|
|
|
|
|
|
|
2022-08-04 15:15:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-01 11:54:04 +01:00
|
|
|
|
2022-09-29 22:23:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-18 13:52:42 -06:00
|
|
|
|
2022-09-29 22:23:19 +01:00
|
|
|
|
2022-09-28 00:51:49 +01:00
|
|
|
|
2022-07-12 21:52:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-21 12:17:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-18 08:09:47 -06:00
|
|
|
|
2022-09-21 12:17:54 +01:00
|
|
|
|
2022-09-28 00:51:49 +01:00
|
|
|
|
2022-09-21 12:17:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-10-21 11:16:41 +01:00
|
|
|
|
|
|
|
|
|
2022-09-21 12:17:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
io_uring/net: always setup an io_async_msghdr
Rather than use an on-stack one and then need to allocate and copy if
async execution is required, always grab one upfront. This should be
very cheap, and potentially even have cache hotness benefits for
back-to-back send/recv requests.
For any recv type of request, this is probably a good choice in general,
as it's expected that no data is available initially. For send this is
not necessarily the case, as space in the socket buffer is expected to
be available. However, getting a cached io_async_msghdr is very cheap,
and as it should be cache hot, probably the difference here is neglible,
if any.
A nice side benefit is that io_setup_async_msg can get killed
completely, which has some nasty iovec manipulation code.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-03-16 17:26:09 -06:00
|
|
|
|
2022-09-21 12:17:54 +01:00
|
|
|
|
2024-04-08 00:54:57 +01:00
|
|
|
|
2022-09-21 12:17:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-12 12:39:54 -06:00
|
|
|
|
2022-09-21 12:17:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
io_uring/net: always setup an io_async_msghdr
Rather than use an on-stack one and then need to allocate and copy if
async execution is required, always grab one upfront. This should be
very cheap, and potentially even have cache hotness benefits for
back-to-back send/recv requests.
For any recv type of request, this is probably a good choice in general,
as it's expected that no data is available initially. For send this is
not necessarily the case, as space in the socket buffer is expected to
be available. However, getting a cached io_async_msghdr is very cheap,
and as it should be cache hot, probably the difference here is neglible,
if any.
A nice side benefit is that io_setup_async_msg can get killed
completely, which has some nasty iovec manipulation code.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-03-16 17:26:09 -06:00
|
|
|
|
2022-09-21 12:17:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-07 12:53:24 -07:00
|
|
|
|
io_uring/net: always setup an io_async_msghdr
Rather than use an on-stack one and then need to allocate and copy if
async execution is required, always grab one upfront. This should be
very cheap, and potentially even have cache hotness benefits for
back-to-back send/recv requests.
For any recv type of request, this is probably a good choice in general,
as it's expected that no data is available initially. For send this is
not necessarily the case, as space in the socket buffer is expected to
be available. However, getting a cached io_async_msghdr is very cheap,
and as it should be cache hot, probably the difference here is neglible,
if any.
A nice side benefit is that io_setup_async_msg can get killed
completely, which has some nasty iovec manipulation code.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-03-16 17:26:09 -06:00
|
|
|
|
2022-09-21 12:17:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-29 22:23:19 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-18 13:52:42 -06:00
|
|
|
|
2022-09-29 22:23:19 +01:00
|
|
|
|
2022-09-28 00:51:49 +01:00
|
|
|
|
2022-09-21 12:17:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-21 12:17:48 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-07 12:43:22 -07:00
|
|
|
|
2022-09-28 00:51:49 +01:00
|
|
|
|
|
|
|
|
|
2022-09-21 12:17:53 +01:00
|
|
|
|
2022-09-28 00:51:49 +01:00
|
|
|
|
|
|
|
|
|
2022-09-21 12:17:49 +01:00
|
|
|
|
|
|
|
|
|
2024-05-08 08:17:50 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 14:06:15 -06:00
|
|
|
|
2024-05-08 08:17:50 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 14:06:15 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 14:06:15 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2024-05-07 14:06:15 -06:00
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2024-05-09 09:31:05 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2024-05-09 09:41:10 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2024-05-08 08:17:50 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-09 09:41:10 -06:00
|
|
|
|
|
|
|
|
|
2024-05-09 09:31:05 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 14:06:15 -06:00
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-17 18:40:16 +00:00
|
|
|
|
2024-02-14 08:23:05 -07:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-09 09:41:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
2024-05-09 09:41:10 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-21 07:43:42 -07:00
|
|
|
|
|
|
|
|
|
2024-05-09 09:41:10 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-30 02:12:28 -07:00
|
|
|
|
2024-05-09 09:41:10 -06:00
|
|
|
|
2024-02-14 08:23:05 -07:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2024-03-18 20:37:22 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-03-20 11:13:49 -06:00
|
|
|
|
2024-03-18 20:37:22 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2024-03-18 20:37:22 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-01-30 08:40:29 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
2024-03-18 20:37:22 -06:00
|
|
|
|
|
|
|
|
|
2023-03-20 11:13:49 -06:00
|
|
|
|
|
|
|
|
|
2022-10-04 20:29:48 -06:00
|
|
|
|
|
|
|
|
|
io_uring/net: ensure socket is marked connected on connect retry
io_uring does non-blocking connection attempts, which can yield some
unexpected results if a connect request is re-attempted by an an
application. This is equivalent to the following sync syscall sequence:
sock = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, IPPROTO_TCP);
connect(sock, &addr, sizeof(addr);
ret == -1 and errno == EINPROGRESS expected here. Now poll for POLLOUT
on sock, and when that returns, we expect the socket to be connected.
But if we follow that procedure with:
connect(sock, &addr, sizeof(addr));
you'd expect ret == -1 and errno == EISCONN here, but you actually get
ret == 0. If we attempt the connection one more time, then we get EISCON
as expected.
io_uring used to do this, but turns out that bluetooth fails with EBADFD
if you attempt to re-connect. Also looks like EISCONN _could_ occur with
this sequence.
Retain the ->in_progress logic, but work-around a potential EISCONN or
EBADFD error and only in those cases look at the sock_error(). This
should work in general and avoid the odd sequence of a repeated connect
request returning success when the socket is already connected.
This is all a side effect of the socket state being in a CONNECTING
state when we get EINPROGRESS, and only a re-connect or other related
operation will turn that into CONNECTED.
Cc: stable@vger.kernel.org
Fixes: 3fb1bd688172 ("io_uring/net: handle -EINPROGRESS correct for IORING_OP_CONNECT")
Link: https://github.com/axboe/liburing/issues/980
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2023-11-03 10:35:40 -06:00
|
|
|
|
2023-03-20 11:13:49 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
io_uring/net: ensure socket is marked connected on connect retry
io_uring does non-blocking connection attempts, which can yield some
unexpected results if a connect request is re-attempted by an an
application. This is equivalent to the following sync syscall sequence:
sock = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, IPPROTO_TCP);
connect(sock, &addr, sizeof(addr);
ret == -1 and errno == EINPROGRESS expected here. Now poll for POLLOUT
on sock, and when that returns, we expect the socket to be connected.
But if we follow that procedure with:
connect(sock, &addr, sizeof(addr));
you'd expect ret == -1 and errno == EISCONN here, but you actually get
ret == 0. If we attempt the connection one more time, then we get EISCON
as expected.
io_uring used to do this, but turns out that bluetooth fails with EBADFD
if you attempt to re-connect. Also looks like EISCONN _could_ occur with
this sequence.
Retain the ->in_progress logic, but work-around a potential EISCONN or
EBADFD error and only in those cases look at the sock_error(). This
should work in general and avoid the odd sequence of a repeated connect
request returning success when the socket is already connected.
This is all a side effect of the socket state being in a CONNECTING
state when we get EINPROGRESS, and only a re-connect or other related
operation will turn that into CONNECTED.
Cc: stable@vger.kernel.org
Fixes: 3fb1bd688172 ("io_uring/net: handle -EINPROGRESS correct for IORING_OP_CONNECT")
Link: https://github.com/axboe/liburing/issues/980
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2023-11-03 10:35:40 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-18 20:37:22 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-07 14:30:09 -06:00
|
|
|
|
2024-06-14 12:30:46 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-13 19:05:02 +09:00
|
|
|
|
2024-06-14 12:30:46 -04:00
|
|
|
|
|
|
|
|
|
2024-07-13 19:05:02 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-14 12:30:46 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-14 12:30:47 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-07-13 19:05:02 +09:00
|
|
|
|
2024-06-14 12:30:47 -04:00
|
|
|
|
|
|
|
|
|
2024-07-13 19:05:02 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-06-14 12:30:47 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-20 15:19:44 -06:00
|
|
|
|
2022-07-07 14:30:09 -06:00
|
|
|
|
2024-03-20 15:19:44 -06:00
|
|
|
|
2024-03-16 15:33:53 -06:00
|
|
|
|
2025-01-22 20:00:57 -07:00
|
|
|
|
2024-03-16 15:33:53 -06:00
|
|
|
|
|
|
|
|
|
2022-07-07 14:30:09 -06:00
|
|
|
|
2022-05-25 06:25:13 -06:00
|
|
|
|