public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: io-uring@vger.kernel.org
Cc: asml.silence@gmail.com
Subject: [PATCH 1/6] io_uring/kbuf: account ring io_buffer_list memory
Date: Tue, 13 May 2025 18:26:46 +0100	[thread overview]
Message-ID: <3985218b50d341273cafff7234e1a7e6d0db9808.1747150490.git.asml.silence@gmail.com> (raw)
In-Reply-To: <cover.1747150490.git.asml.silence@gmail.com>

Follow the non-ringed pbuf struct io_buffer_list allocations and account
it against the memcg. There is low chance of that being an actual
problem as ring provided buffer should either ping user memory or
allocate it, which is already accounted.

Cc: stable@vger.kernel.org # 6.1
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 io_uring/kbuf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/io_uring/kbuf.c b/io_uring/kbuf.c
index 1cf0d2c01287..446207db1edf 100644
--- a/io_uring/kbuf.c
+++ b/io_uring/kbuf.c
@@ -621,7 +621,7 @@ int io_register_pbuf_ring(struct io_ring_ctx *ctx, void __user *arg)
 		io_destroy_bl(ctx, bl);
 	}
 
-	free_bl = bl = kzalloc(sizeof(*bl), GFP_KERNEL);
+	free_bl = bl = kzalloc(sizeof(*bl), GFP_KERNEL_ACCOUNT);
 	if (!bl)
 		return -ENOMEM;
 
-- 
2.49.0


  reply	other threads:[~2025-05-13 17:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-13 17:26 [PATCH 0/6] provided buffer cleanups Pavel Begunkov
2025-05-13 17:26 ` Pavel Begunkov [this message]
2025-05-13 20:47   ` [PATCH 1/6] io_uring/kbuf: account ring io_buffer_list memory Jens Axboe
2025-05-13 17:26 ` [PATCH 2/6] io_uring/kbuf: use mem_is_zero() Pavel Begunkov
2025-05-13 17:26 ` [PATCH 3/6] io_uring/kbuf: drop extra vars in io_register_pbuf_ring Pavel Begunkov
2025-05-13 17:26 ` [PATCH 4/6] io_uring/kbuf: don't compute size twice on prep Pavel Begunkov
2025-05-13 17:26 ` [PATCH 5/6] io_uring/kbuf: refactor __io_remove_buffers Pavel Begunkov
2025-05-13 17:26 ` [PATCH 6/6] io_uring/kbuf: unify legacy buf provision and removal Pavel Begunkov
2025-05-13 20:47 ` [PATCH 0/6] provided buffer cleanups Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3985218b50d341273cafff7234e1a7e6d0db9808.1747150490.git.asml.silence@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=io-uring@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox