summaryrefslogtreecommitdiff
path: root/io_uring/poll.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2024-03-20 15:19:44 -0600
committerJens Axboe <axboe@kernel.dk>2024-04-15 08:10:25 -0600
commit414d0f45c316221acbf066658afdbae5b354a5cc (patch)
tree9c872a002b5fa5119cd91d706045ebb915c338d9 /io_uring/poll.h
parente10677a8f6980dbae2e866b8320d90bae07e87ee (diff)
io_uring/alloc_cache: switch to array based caching
Currently lists are being used to manage this, but best practice is usually to have these in an array instead as that it cheaper to manage. Outside of that detail, games are also played with KASAN as the list is inside the cached entry itself. Finally, all users of this need a struct io_cache_entry embedded in their struct, which is union'ized with something else in there that isn't used across the free -> realloc cycle. Get rid of all of that, and simply have it be an array. This will not change the memory used, as we're just trading an 8-byte member entry for the per-elem array size. This reduces the overhead of the recycled allocations, and it reduces the amount of code code needed to support recycling to about half of what it currently is. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/poll.h')
-rw-r--r--io_uring/poll.h9
1 files changed, 1 insertions, 8 deletions
diff --git a/io_uring/poll.h b/io_uring/poll.h
index 1dacae9e816c..5c240f11069a 100644
--- a/io_uring/poll.h
+++ b/io_uring/poll.h
@@ -1,7 +1,5 @@
// SPDX-License-Identifier: GPL-2.0
-#include "alloc_cache.h"
-
enum {
IO_APOLL_OK,
IO_APOLL_ABORTED,
@@ -17,10 +15,7 @@ struct io_poll {
};
struct async_poll {
- union {
- struct io_poll poll;
- struct io_cache_entry cache;
- };
+ struct io_poll poll;
struct io_poll *double_poll;
};
@@ -46,6 +41,4 @@ int io_arm_poll_handler(struct io_kiocb *req, unsigned issue_flags);
bool io_poll_remove_all(struct io_ring_ctx *ctx, struct task_struct *tsk,
bool cancel_all);
-void io_apoll_cache_free(struct io_cache_entry *entry);
-
void io_poll_task_func(struct io_kiocb *req, struct io_tw_state *ts);