From: Pavel Begunkov Date: Fri, 9 May 2025 11:12:47 +0000 (+0100) Subject: io_uring: account drain memory to cgroup X-Git-Tag: v6.16-rc1~215^2~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f979c20547e72568e3c793bc92c7522bc3166246;p=thirdparty%2Flinux.git io_uring: account drain memory to cgroup Account drain allocations against memcg. It's not a big problem as each such allocation is paired with a request, which is accounted, but it's nicer to follow the limits more closely. Cc: stable@vger.kernel.org # 6.1 Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/f8dfdbd755c41fd9c75d12b858af07dfba5bbb68.1746788718.git.asml.silence@gmail.com Signed-off-by: Jens Axboe --- diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 4034b1db7135a..76b33762a28de 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -1675,7 +1675,7 @@ queue: spin_unlock(&ctx->completion_lock); io_prep_async_link(req); - de = kmalloc(sizeof(*de), GFP_KERNEL); + de = kmalloc(sizeof(*de), GFP_KERNEL_ACCOUNT); if (!de) { ret = -ENOMEM; io_req_defer_failed(req, ret);