2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-20 15:19:44 -06:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2023-06-08 09:38:36 -07:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2022-06-13 07:07:23 -06:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2022-06-16 10:22:02 +01:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:49 +01:00
|
|
|
|
2022-06-23 14:24:47 +01:00
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-20 16:57:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2022-06-23 14:24:44 +01:00
|
|
|
|
|
|
|
|
|
2023-02-27 09:41:20 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-20 16:57:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-20 16:57:42 +00:00
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-16 10:22:10 +01:00
|
|
|
|
|
|
|
|
|
2022-06-16 10:22:12 +01:00
|
|
|
|
2022-11-11 16:51:30 +00:00
|
|
|
|
|
|
|
|
|
2022-06-16 10:22:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-27 09:41:20 -07:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-02-27 09:41:20 -07:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-30 02:12:24 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-30 02:12:25 -07:00
|
|
|
|
2023-01-10 10:44:37 -07:00
|
|
|
|
2024-01-29 11:57:11 -07:00
|
|
|
|
2022-06-30 02:12:24 -07:00
|
|
|
|
|
|
|
|
|
2024-01-29 11:52:54 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-10 10:44:37 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2023-03-27 16:38:15 +01:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2023-01-10 10:44:37 -07:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
io_uring: move struct io_kiocb from task_struct to io_uring_task
Rather than store the task_struct itself in struct io_kiocb, store
the io_uring specific task_struct. The life times are the same in terms
of io_uring, and this avoids doing some dereferences through the
task_struct. For the hot path of putting local task references, we can
deref req->tctx instead, which we'll need anyway in that function
regardless of whether it's local or remote references.
This is mostly straight forward, except the original task PF_EXITING
check needs a bit of tweaking. task_work is _always_ run from the
originating task, except in the fallback case, where it's run from a
kernel thread. Replace the potentially racy (in case of fallback work)
checks for req->task->flags with current->flags. It's either the still
the original task, in which case PF_EXITING will be sane, or it has
PF_KTHREAD set, in which case it's fallback work. Both cases should
prevent moving forward with the given request.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2024-11-03 10:23:38 -07:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-30 15:21:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-30 15:21:54 +00:00
|
|
|
|
2022-11-30 15:21:52 +00:00
|
|
|
|
|
|
|
|
|
2022-11-20 16:57:42 +00:00
|
|
|
|
2022-11-30 15:21:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-20 16:57:42 +00:00
|
|
|
|
2022-11-30 15:21:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-20 16:57:42 +00:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2022-06-30 02:12:24 -07:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-10 10:44:37 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-20 15:08:21 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-10 10:44:37 -07:00
|
|
|
|
2023-01-20 15:08:21 -07:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2025-01-30 08:40:29 -07:00
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2022-06-30 02:12:24 -07:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-18 22:00:31 +00:00
|
|
|
|
2022-06-30 02:12:27 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-17 09:48:00 +01:00
|
|
|
|
2023-03-27 16:38:15 +01:00
|
|
|
|
2022-06-30 02:12:25 -07:00
|
|
|
|
|
|
|
|
|
2024-01-29 11:57:11 -07:00
|
|
|
|
|
|
|
|
|
2022-06-30 02:12:24 -07:00
|
|
|
|
2022-06-17 09:48:00 +01:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
2022-11-17 18:40:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-01 12:49:37 -07:00
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2024-07-29 19:03:33 -04:00
|
|
|
|
2022-06-30 02:12:24 -07:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
2023-06-02 08:41:46 -06:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-03-27 16:38:15 +01:00
|
|
|
|
2024-01-29 11:57:11 -07:00
|
|
|
|
2025-01-28 00:55:24 +00:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2024-01-29 11:57:11 -07:00
|
|
|
|
2025-01-28 00:55:24 +00:00
|
|
|
|
2024-01-29 11:57:11 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2024-09-30 14:35:52 -06:00
|
|
|
|
|
|
|
|
|
2022-06-16 10:22:12 +01:00
|
|
|
|
2022-11-30 15:21:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2022-11-30 15:21:55 +00:00
|
|
|
|
|
|
|
|
|
2023-01-10 10:44:37 -07:00
|
|
|
|
2023-03-27 16:38:15 +01:00
|
|
|
|
2023-01-10 10:44:37 -07:00
|
|
|
|
2022-11-30 15:21:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2022-11-30 15:21:55 +00:00
|
|
|
|
2023-03-27 16:38:15 +01:00
|
|
|
|
2022-11-30 15:21:55 +00:00
|
|
|
|
2023-03-27 16:38:15 +01:00
|
|
|
|
2022-11-30 15:21:55 +00:00
|
|
|
|
|
|
|
|
|
2023-03-27 16:38:15 +01:00
|
|
|
|
2023-01-10 10:44:37 -07:00
|
|
|
|
2023-03-27 16:38:15 +01:00
|
|
|
|
2022-11-30 15:21:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:45 +01:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-21 14:34:15 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-21 14:34:15 -06:00
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-20 10:18:45 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:45 +01:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-11-11 16:51:29 +00:00
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-07 15:13:14 +01:00
|
|
|
|
2022-11-11 16:51:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-07-07 15:13:14 +01:00
|
|
|
|
2022-11-11 16:51:29 +00:00
|
|
|
|
2022-06-23 14:24:49 +01:00
|
|
|
|
2022-11-11 16:51:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:49 +01:00
|
|
|
|
2022-11-11 16:51:29 +00:00
|
|
|
|
2022-06-23 14:24:49 +01:00
|
|
|
|
2022-11-11 16:51:29 +00:00
|
|
|
|
2022-06-23 14:24:49 +01:00
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:49 +01:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2022-06-23 14:24:44 +01:00
|
|
|
|
2023-02-27 09:41:20 -07:00
|
|
|
|
2022-11-11 16:51:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2022-06-23 14:24:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-12-13 08:58:15 -07:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2023-12-13 08:58:15 -07:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2023-12-13 08:58:15 -07:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-30 14:22:36 -06:00
|
|
|
|
2023-01-09 14:46:10 -07:00
|
|
|
|
2024-09-30 14:22:36 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-01-09 14:46:10 -07:00
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:48 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:49 +01:00
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
2023-02-27 09:41:20 -07:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2022-06-23 14:24:49 +01:00
|
|
|
|
|
|
|
|
|
2022-07-07 15:13:17 +01:00
|
|
|
|
2024-03-07 18:06:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:48 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:49 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:48 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:49 +01:00
|
|
|
|
2022-06-23 14:24:48 +01:00
|
|
|
|
|
|
|
|
|
2022-05-27 10:55:07 -06:00
|
|
|
|
|
|
|
|
|
2023-01-09 14:46:10 -07:00
|
|
|
|
2024-09-30 14:22:36 -06:00
|
|
|
|
2022-06-23 14:24:49 +01:00
|
|
|
|
2023-01-09 14:46:10 -07:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2022-06-23 14:24:47 +01:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2022-06-23 14:24:47 +01:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2022-05-27 10:55:07 -06:00
|
|
|
|
2024-09-30 14:22:36 -06:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2022-06-23 14:24:49 +01:00
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:45 +01:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
2023-06-08 09:38:36 -07:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2022-06-23 14:24:49 +01:00
|
|
|
|
|
|
|
|
|
2022-11-20 16:57:41 +00:00
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:49 +01:00
|
|
|
|
2022-11-20 16:57:41 +00:00
|
|
|
|
2022-06-23 14:24:49 +01:00
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
io_uring/poll: allow some retries for poll triggering spuriously
If we get woken spuriously when polling and fail the operation with
-EAGAIN again, then we generally only allow polling again if data
had been transferred at some point. This is indicated with
REQ_F_PARTIAL_IO. However, if the spurious poll triggers when the socket
was originally empty, then we haven't transferred data yet and we will
fail the poll re-arm. This either punts the socket to io-wq if it's
blocking, or it fails the request with -EAGAIN if not. Neither condition
is desirable, as the former will slow things down, while the latter
will make the application confused.
We want to ensure that a repeated poll trigger doesn't lead to infinite
work making no progress, that's what the REQ_F_PARTIAL_IO check was
for. But it doesn't protect against a loop post the first receive, and
it's unnecessarily strict if we started out with an empty socket.
Add a somewhat random retry count, just to put an upper limit on the
potential number of retries that will be done. This should be high enough
that we won't really hit it in practice, unless something needs to be
aborted anyway.
Cc: stable@vger.kernel.org # v5.10+
Link: https://github.com/axboe/liburing/issues/364
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2023-02-25 12:53:53 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-12-16 15:46:10 -05:00
|
|
|
|
2025-01-22 20:00:57 -07:00
|
|
|
|
2024-12-16 15:46:10 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:46 +01:00
|
|
|
|
io_uring/poll: allow some retries for poll triggering spuriously
If we get woken spuriously when polling and fail the operation with
-EAGAIN again, then we generally only allow polling again if data
had been transferred at some point. This is indicated with
REQ_F_PARTIAL_IO. However, if the spurious poll triggers when the socket
was originally empty, then we haven't transferred data yet and we will
fail the poll re-arm. This either punts the socket to io-wq if it's
blocking, or it fails the request with -EAGAIN if not. Neither condition
is desirable, as the former will slow things down, while the latter
will make the application confused.
We want to ensure that a repeated poll trigger doesn't lead to infinite
work making no progress, that's what the REQ_F_PARTIAL_IO check was
for. But it doesn't protect against a loop post the first receive, and
it's unnecessarily strict if we started out with an empty socket.
Add a somewhat random retry count, just to put an upper limit on the
potential number of retries that will be done. This should be high enough
that we won't really hit it in practice, unless something needs to be
aborted anyway.
Cc: stable@vger.kernel.org # v5.10+
Link: https://github.com/axboe/liburing/issues/364
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2023-02-25 12:53:53 -07:00
|
|
|
|
2022-06-23 14:24:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
io_uring/poll: allow some retries for poll triggering spuriously
If we get woken spuriously when polling and fail the operation with
-EAGAIN again, then we generally only allow polling again if data
had been transferred at some point. This is indicated with
REQ_F_PARTIAL_IO. However, if the spurious poll triggers when the socket
was originally empty, then we haven't transferred data yet and we will
fail the poll re-arm. This either punts the socket to io-wq if it's
blocking, or it fails the request with -EAGAIN if not. Neither condition
is desirable, as the former will slow things down, while the latter
will make the application confused.
We want to ensure that a repeated poll trigger doesn't lead to infinite
work making no progress, that's what the REQ_F_PARTIAL_IO check was
for. But it doesn't protect against a loop post the first receive, and
it's unnecessarily strict if we started out with an empty socket.
Add a somewhat random retry count, just to put an upper limit on the
potential number of retries that will be done. This should be high enough
that we won't really hit it in practice, unless something needs to be
aborted anyway.
Cc: stable@vger.kernel.org # v5.10+
Link: https://github.com/axboe/liburing/issues/364
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2023-02-25 12:53:53 -07:00
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
2023-01-12 06:44:10 -08:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
2022-05-27 10:55:07 -06:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-28 20:08:24 -07:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-03-27 19:56:18 -06:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:49 +01:00
|
|
|
|
2022-06-23 14:24:48 +01:00
|
|
|
|
|
|
|
|
|
2022-06-16 13:57:20 +01:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-30 14:22:36 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-11-03 10:22:43 -07:00
|
|
|
|
2024-09-30 14:22:36 -06:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2024-09-30 14:22:36 -06:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-30 14:22:36 -06:00
|
|
|
|
|
|
|
|
|
2022-06-16 10:22:10 +01:00
|
|
|
|
2024-09-30 14:22:36 -06:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2022-06-16 10:22:02 +01:00
|
|
|
|
2024-11-03 10:22:43 -07:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-30 14:29:06 -06:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
2024-09-30 14:22:36 -06:00
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2022-06-16 10:22:02 +01:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-01-28 20:11:55 -07:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-30 14:29:06 -06:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2024-09-30 14:22:36 -06:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-16 10:22:10 +01:00
|
|
|
|
2024-09-30 14:22:36 -06:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2022-06-16 10:22:02 +01:00
|
|
|
|
2024-09-30 14:29:06 -06:00
|
|
|
|
2023-06-23 09:04:35 -06:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-16 10:22:12 +01:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2022-06-16 10:22:12 +01:00
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2022-06-16 10:22:12 +01:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
2022-06-16 10:22:12 +01:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
2024-09-30 14:22:36 -06:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-23 10:36:43 -06:00
|
|
|
|
|
|
|
|
|
2024-09-30 14:29:06 -06:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2024-09-30 14:29:06 -06:00
|
|
|
|
2022-06-16 10:22:03 +01:00
|
|
|
|
2024-09-30 14:29:06 -06:00
|
|
|
|
2022-06-16 10:22:03 +01:00
|
|
|
|
2024-09-30 14:29:06 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
2022-06-16 10:22:11 +01:00
|
|
|
|
|
|
|
|
|
2022-06-16 10:22:09 +01:00
|
|
|
|
2022-06-16 10:22:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-09-30 14:22:36 -06:00
|
|
|
|
2022-06-16 10:22:12 +01:00
|
|
|
|
|
|
|
|
|
2022-06-16 10:22:09 +01:00
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-27 10:55:07 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-09-28 09:49:28 -06:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:49 +01:00
|
|
|
|
2022-06-23 14:24:48 +01:00
|
|
|
|
2022-06-23 14:24:47 +01:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
2022-06-23 14:24:48 +01:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2023-06-23 09:54:56 -06:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-17 19:50:24 -06:00
|
|
|
|
2024-09-30 14:29:06 -06:00
|
|
|
|
2022-06-16 10:22:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-06-20 01:26:01 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-08-11 09:11:15 +02:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-06-17 19:50:24 -06:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-15 15:29:51 +00:00
|
|
|
|
|
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
2023-06-17 19:50:24 -06:00
|
|
|
|
2022-05-25 20:31:09 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|