Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring/rsrc: get rid of io_rsrc_node allocation cache

It's not going to be needed in the fast path going forward, so kill it
off.

Signed-off-by: Jens Axboe <axboe@kernel.dk>

+7 -20
-3
include/linux/io_uring_types.h
··· 370 370 struct io_rsrc_data *file_data; 371 371 struct io_rsrc_data *buf_data; 372 372 373 - /* protected by ->uring_lock */ 374 - struct io_alloc_cache rsrc_node_cache; 375 - 376 373 u32 pers_next; 377 374 struct xarray personalities; 378 375
+1 -5
io_uring/io_uring.c
··· 312 312 INIT_LIST_HEAD(&ctx->sqd_list); 313 313 INIT_LIST_HEAD(&ctx->cq_overflow_list); 314 314 INIT_LIST_HEAD(&ctx->io_buffers_cache); 315 - ret = io_alloc_cache_init(&ctx->rsrc_node_cache, IO_NODE_ALLOC_CACHE_MAX, 316 - sizeof(struct io_rsrc_node)); 317 - ret |= io_alloc_cache_init(&ctx->apoll_cache, IO_POLL_ALLOC_CACHE_MAX, 315 + ret = io_alloc_cache_init(&ctx->apoll_cache, IO_POLL_ALLOC_CACHE_MAX, 318 316 sizeof(struct async_poll)); 319 317 ret |= io_alloc_cache_init(&ctx->netmsg_cache, IO_ALLOC_CACHE_MAX, 320 318 sizeof(struct io_async_msghdr)); ··· 356 358 free_ref: 357 359 percpu_ref_exit(&ctx->refs); 358 360 err: 359 - io_alloc_cache_free(&ctx->rsrc_node_cache, kfree); 360 361 io_alloc_cache_free(&ctx->apoll_cache, kfree); 361 362 io_alloc_cache_free(&ctx->netmsg_cache, io_netmsg_cache_free); 362 363 io_alloc_cache_free(&ctx->rw_cache, io_rw_cache_free); ··· 2737 2740 2738 2741 WARN_ON_ONCE(!list_empty(&ctx->ltimeout_list)); 2739 2742 2740 - io_alloc_cache_free(&ctx->rsrc_node_cache, kfree); 2741 2743 if (ctx->mm_account) { 2742 2744 mmdrop(ctx->mm_account); 2743 2745 ctx->mm_account = NULL;
+6 -12
io_uring/rsrc.c
··· 13 13 #include <uapi/linux/io_uring.h> 14 14 15 15 #include "io_uring.h" 16 - #include "alloc_cache.h" 17 16 #include "openclose.h" 18 17 #include "rsrc.h" 19 18 #include "memmap.h" ··· 128 129 { 129 130 struct io_rsrc_node *node; 130 131 131 - node = io_alloc_cache_get(&ctx->rsrc_node_cache); 132 - if (!node) { 133 - node = kzalloc(sizeof(*node), GFP_KERNEL); 134 - if (!node) 135 - return NULL; 132 + node = kzalloc(sizeof(*node), GFP_KERNEL); 133 + if (node) { 134 + node->ctx = ctx; 135 + node->refs = 1; 136 + node->type = type; 136 137 } 137 - 138 - node->ctx = ctx; 139 - node->refs = 1; 140 - node->type = type; 141 138 return node; 142 139 } 143 140 ··· 482 487 break; 483 488 } 484 489 485 - if (!io_alloc_cache_put(&ctx->rsrc_node_cache, node)) 486 - kfree(node); 490 + kfree(node); 487 491 } 488 492 489 493 static void __io_sqe_files_unregister(struct io_ring_ctx *ctx)