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: export io_[un]account_mem

Export pinned memory accounting helpers, they'll be used by zcrx
shortly.

Cc: stable@vger.kernel.org
Fixes: cf96310c5f9a0 ("io_uring/zcrx: add io_zcrx_area")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/9a61e54bd89289b39570ae02fe620e12487439e4.1752699568.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Pavel Begunkov and committed by
Jens Axboe
11fbada7 0ebc9a7e

+4 -2
+2 -2
io_uring/rsrc.c
··· 55 55 return 0; 56 56 } 57 57 58 - static void io_unaccount_mem(struct io_ring_ctx *ctx, unsigned long nr_pages) 58 + void io_unaccount_mem(struct io_ring_ctx *ctx, unsigned long nr_pages) 59 59 { 60 60 if (ctx->user) 61 61 __io_unaccount_mem(ctx->user, nr_pages); ··· 64 64 atomic64_sub(nr_pages, &ctx->mm_account->pinned_vm); 65 65 } 66 66 67 - static int io_account_mem(struct io_ring_ctx *ctx, unsigned long nr_pages) 67 + int io_account_mem(struct io_ring_ctx *ctx, unsigned long nr_pages) 68 68 { 69 69 int ret; 70 70
+2
io_uring/rsrc.h
··· 120 120 int io_files_update_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe); 121 121 122 122 int __io_account_mem(struct user_struct *user, unsigned long nr_pages); 123 + int io_account_mem(struct io_ring_ctx *ctx, unsigned long nr_pages); 124 + void io_unaccount_mem(struct io_ring_ctx *ctx, unsigned long nr_pages); 123 125 124 126 static inline void __io_unaccount_mem(struct user_struct *user, 125 127 unsigned long nr_pages)