* [PATCH] io_uring: Simplify the allocation of slab caches
@ 2024-01-30 10:02 Kunwu Chan
2024-02-08 18:32 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Kunwu Chan @ 2024-01-30 10:02 UTC (permalink / raw)
To: axboe, asml.silence; +Cc: io-uring, linux-kernel, Kunwu Chan
commit 0a31bd5f2bbb ("KMEM_CACHE(): simplify slab cache creation")
introduces a new macro.
Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
to simplify the creation of SLAB caches.
Signed-off-by: Kunwu Chan <[email protected]>
---
io_uring/io_uring.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index cd9a137ad6ce..9a810b1169f2 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -4175,9 +4175,8 @@ static int __init io_uring_init(void)
SLAB_ACCOUNT | SLAB_TYPESAFE_BY_RCU,
offsetof(struct io_kiocb, cmd.data),
sizeof_field(struct io_kiocb, cmd.data), NULL);
- io_buf_cachep = kmem_cache_create("io_buffer", sizeof(struct io_buffer), 0,
- SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT,
- NULL);
+ io_buf_cachep = KMEM_CACHE(io_buffer,
+ SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT);
#ifdef CONFIG_SYSCTL
register_sysctl_init("kernel", kernel_io_uring_disabled_table);
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] io_uring: Simplify the allocation of slab caches
2024-01-30 10:02 [PATCH] io_uring: Simplify the allocation of slab caches Kunwu Chan
@ 2024-02-08 18:32 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2024-02-08 18:32 UTC (permalink / raw)
To: asml.silence, Kunwu Chan; +Cc: io-uring, linux-kernel
On Tue, 30 Jan 2024 18:02:47 +0800, Kunwu Chan wrote:
> commit 0a31bd5f2bbb ("KMEM_CACHE(): simplify slab cache creation")
> introduces a new macro.
> Use the new KMEM_CACHE() macro instead of direct kmem_cache_create
> to simplify the creation of SLAB caches.
>
>
Applied, thanks!
[1/1] io_uring: Simplify the allocation of slab caches
commit: 898e3028588e3b6d789774af623d419295c75257
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-02-08 18:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-30 10:02 [PATCH] io_uring: Simplify the allocation of slab caches Kunwu Chan
2024-02-08 18:32 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox