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: Simplify the allocation of slab caches

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 <chentao@kylinos.cn>
Link: https://lore.kernel.org/r/20240130100247.81460-1-chentao@kylinos.cn
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Kunwu Chan and committed by
Jens Axboe
a6e959bd da08d2ed

+2 -3
+2 -3
io_uring/io_uring.c
··· 4176 4176 SLAB_ACCOUNT | SLAB_TYPESAFE_BY_RCU, 4177 4177 offsetof(struct io_kiocb, cmd.data), 4178 4178 sizeof_field(struct io_kiocb, cmd.data), NULL); 4179 - io_buf_cachep = kmem_cache_create("io_buffer", sizeof(struct io_buffer), 0, 4180 - SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT, 4181 - NULL); 4179 + io_buf_cachep = KMEM_CACHE(io_buffer, 4180 + SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT); 4182 4181 4183 4182 #ifdef CONFIG_SYSCTL 4184 4183 register_sysctl_init("kernel", kernel_io_uring_disabled_table);