io_uring: account drain memory to cgroup

JIRA: https://issues.redhat.com/browse/RHEL-105612

commit f979c20547e72568e3c793bc92c7522bc3166246
Author: Pavel Begunkov <asml.silence@gmail.com>
Date:   Fri May 9 12:12:47 2025 +0100

    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 <asml.silence@gmail.com>
    Link: https://lore.kernel.org/r/f8dfdbd755c41fd9c75d12b858af07dfba5bbb68.1746788718.git.asml.silence@gmail.com
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
This commit is contained in:
Jeff Moyer
2025-10-27 13:18:47 -04:00
parent 64217b2ca1
commit e1550cb057
+1 -1
View File
@@ -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);