Not many aware, but io_uring submission queue has two levels. The first level usually appears as sq_array and stores indexes into the actual SQ. To my knowledge, no one has ever seriously used it, nor liburing exposes it to users. Add IORING_SETUP_NO_SQARRAY, when set we don't bother creating and using the sq_array and SQ heads/tails will be pointing directly into the SQ. Improves memory footprint, in term of both allocations as well as cache usage, and also should make io_get_sqe() less branchy in the end.
Showing the changes to include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -185,6 +185,11 @@ enum { · 184 unmodified lines | |||
| 185 | */ | 185 | */ |
| 186 | #define IORING_SETUP_REGISTERED_FD_ONLY (1U << 15) | 186 | #define IORING_SETUP_REGISTERED_FD_ONLY (1U << 15) |
| 187 | 187 | ||
| 188 | /* | ||
| 189 | * Removes indirection through the SQ index array. | ||
| 190 | */ | ||
| 191 | #define IORING_SETUP_NO_SQARRAY (1U << 16) | ||
| 192 | |||
| 188 | enum io_uring_op { | 193 | enum io_uring_op { |
| 189 | IORING_OP_NOP, | 194 | IORING_OP_NOP, |
| 190 | IORING_OP_READV, | 195 | IORING_OP_READV, |