Skip to content

Commit ce94640

Browse files
krismanaxboe
authored andcommitted
io_uring/msg_ring: Drop custom destructor
kfree can handle slab objects nowadays. Drop the extra callback and just use kfree. Signed-off-by: Gabriel Krisman Bertazi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent ef623a6 commit ce94640

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

io_uring/io_uring.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ static __cold struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p)
361361
io_alloc_cache_free(&ctx->netmsg_cache, io_netmsg_cache_free);
362362
io_alloc_cache_free(&ctx->rw_cache, io_rw_cache_free);
363363
io_alloc_cache_free(&ctx->uring_cache, kfree);
364-
io_alloc_cache_free(&ctx->msg_cache, io_msg_cache_free);
364+
io_alloc_cache_free(&ctx->msg_cache, kfree);
365365
io_futex_cache_free(ctx);
366366
kvfree(ctx->cancel_table.hbs);
367367
xa_destroy(&ctx->io_bl_xa);
@@ -2696,7 +2696,7 @@ static __cold void io_ring_ctx_free(struct io_ring_ctx *ctx)
26962696
io_alloc_cache_free(&ctx->netmsg_cache, io_netmsg_cache_free);
26972697
io_alloc_cache_free(&ctx->rw_cache, io_rw_cache_free);
26982698
io_alloc_cache_free(&ctx->uring_cache, kfree);
2699-
io_alloc_cache_free(&ctx->msg_cache, io_msg_cache_free);
2699+
io_alloc_cache_free(&ctx->msg_cache, kfree);
27002700
io_futex_cache_free(ctx);
27012701
io_destroy_buffers(ctx);
27022702
io_free_region(ctx, &ctx->param_region);

io_uring/msg_ring.c

-7
Original file line numberDiff line numberDiff line change
@@ -354,10 +354,3 @@ int io_uring_sync_msg_ring(struct io_uring_sqe *sqe)
354354
return __io_msg_ring_data(fd_file(f)->private_data,
355355
&io_msg, IO_URING_F_UNLOCKED);
356356
}
357-
358-
void io_msg_cache_free(const void *entry)
359-
{
360-
struct io_kiocb *req = (struct io_kiocb *) entry;
361-
362-
kmem_cache_free(req_cachep, req);
363-
}

io_uring/msg_ring.h

-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@ int io_uring_sync_msg_ring(struct io_uring_sqe *sqe);
44
int io_msg_ring_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
55
int io_msg_ring(struct io_kiocb *req, unsigned int issue_flags);
66
void io_msg_ring_cleanup(struct io_kiocb *req);
7-
void io_msg_cache_free(const void *entry);

0 commit comments

Comments
 (0)