Skip to content

Commit da22bdf

Browse files
committed
io_uring/poll: shrink alloc cache size to 32
This should be plenty, rather than the default of 128, and matches what we have on the rsrc and futex side as well. Signed-off-by: Jens Axboe <[email protected]>
1 parent 414d0f4 commit da22bdf

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

io_uring/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ static __cold struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p)
308308
INIT_HLIST_HEAD(&ctx->io_buf_list);
309309
ret = io_alloc_cache_init(&ctx->rsrc_node_cache, IO_NODE_ALLOC_CACHE_MAX,
310310
sizeof(struct io_rsrc_node));
311-
ret |= io_alloc_cache_init(&ctx->apoll_cache, IO_ALLOC_CACHE_MAX,
311+
ret |= io_alloc_cache_init(&ctx->apoll_cache, IO_POLL_ALLOC_CACHE_MAX,
312312
sizeof(struct async_poll));
313313
ret |= io_alloc_cache_init(&ctx->netmsg_cache, IO_ALLOC_CACHE_MAX,
314314
sizeof(struct io_async_msghdr));

io_uring/poll.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0
22

3+
#define IO_POLL_ALLOC_CACHE_MAX 32
4+
35
enum {
46
IO_APOLL_OK,
57
IO_APOLL_ABORTED,

0 commit comments

Comments
 (0)