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/kbuf: remove legacy kbuf kmem cache

Remove the kmem cache used by legacy provided buffers.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/8195c207d8524d94e972c0c82de99282289f7f5c.1738724373.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Pavel Begunkov and committed by
Jens Axboe
9afe6847 7919292a

+2 -7
-2
io_uring/io_uring.c
··· 3927 3927 req_cachep = kmem_cache_create("io_kiocb", sizeof(struct io_kiocb), &kmem_args, 3928 3928 SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT | 3929 3929 SLAB_TYPESAFE_BY_RCU); 3930 - io_buf_cachep = KMEM_CACHE(io_buffer, 3931 - SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT); 3932 3930 3933 3931 iou_wq = alloc_workqueue("iou_exit", WQ_UNBOUND, 64); 3934 3932 BUG_ON(!iou_wq);
-1
io_uring/io_uring.h
··· 418 418 } 419 419 420 420 extern struct kmem_cache *req_cachep; 421 - extern struct kmem_cache *io_buf_cachep; 422 421 423 422 static inline struct io_kiocb *io_extract_req(struct io_ring_ctx *ctx) 424 423 {
+2 -4
io_uring/kbuf.c
··· 20 20 /* BIDs are addressed by a 16-bit field in a CQE */ 21 21 #define MAX_BIDS_PER_BGID (1 << 16) 22 22 23 - struct kmem_cache *io_buf_cachep; 24 - 25 23 struct io_provide_buf { 26 24 struct file *file; 27 25 __u64 addr; ··· 409 411 410 412 list_for_each_safe(item, tmp, &ctx->io_buffers_cache) { 411 413 buf = list_entry(item, struct io_buffer, list); 412 - kmem_cache_free(io_buf_cachep, buf); 414 + kfree(buf); 413 415 } 414 416 } 415 417 ··· 519 521 spin_unlock(&ctx->completion_lock); 520 522 } 521 523 522 - buf = kmem_cache_alloc(io_buf_cachep, GFP_KERNEL); 524 + buf = kmalloc(sizeof(*buf), GFP_KERNEL_ACCOUNT); 523 525 if (!buf) 524 526 return -ENOMEM; 525 527 list_add_tail(&buf->list, &ctx->io_buffers_cache);