This is a note to let you know that I've just added the patch titled io_uring: enable io_mem_alloc/free to be used in other parts to the 6.6-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: io_uring-enable-io_mem_alloc-free-to-be-used-in-other-parts.patch and it can be found in the queue-6.6 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From edecf1689768452ba1a64b7aaf3a47a817da651a Mon Sep 17 00:00:00 2001 From: Jens Axboe <axboe@xxxxxxxxx> Date: Mon, 27 Nov 2023 20:53:52 -0700 Subject: io_uring: enable io_mem_alloc/free to be used in other parts From: Jens Axboe <axboe@xxxxxxxxx> commit edecf1689768452ba1a64b7aaf3a47a817da651a upstream. In preparation for using these helpers, make them non-static and add them to our internal header. Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- io_uring/io_uring.c | 4 ++-- io_uring/io_uring.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -2659,7 +2659,7 @@ static int io_cqring_wait(struct io_ring return READ_ONCE(rings->cq.head) == READ_ONCE(rings->cq.tail) ? ret : 0; } -static void io_mem_free(void *ptr) +void io_mem_free(void *ptr) { if (!ptr) return; @@ -2771,7 +2771,7 @@ static void io_rings_free(struct io_ring } } -static void *io_mem_alloc(size_t size) +void *io_mem_alloc(size_t size) { gfp_t gfp = GFP_KERNEL_ACCOUNT | __GFP_ZERO | __GFP_NOWARN | __GFP_COMP; void *ret; --- a/io_uring/io_uring.h +++ b/io_uring/io_uring.h @@ -86,6 +86,9 @@ bool __io_alloc_req_refill(struct io_rin bool io_match_task_safe(struct io_kiocb *head, struct task_struct *task, bool cancel_all); +void *io_mem_alloc(size_t size); +void io_mem_free(void *ptr); + #if defined(CONFIG_PROVE_LOCKING) static inline void io_lockdep_assert_cq_locked(struct io_ring_ctx *ctx) { Patches currently in stable-queue which might be from axboe@xxxxxxxxx are queue-6.6/io_uring-enable-io_mem_alloc-free-to-be-used-in-other-parts.patch queue-6.6/io_uring-kbuf-defer-release-of-mapped-buffer-rings.patch queue-6.6/io_uring-don-t-allow-discontig-pages-for-ioring_setup_no_mmap.patch queue-6.6/bcache-revert-replacing-is_err_or_null-with-is_err.patch queue-6.6/powerpc-don-t-clobber-f0-vs0-during-fp-altivec-register-save.patch queue-6.6/io_uring-free-io_buffer_list-entries-via-rcu.patch queue-6.6/io_uring-don-t-guard-ioring_off_pbuf_ring-with-setup_no_mmap.patch