]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
io_uring/zcrx: account niov arrays to cgroup
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 16 Sep 2025 14:28:03 +0000 (15:28 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:36:51 +0000 (15:36 -0500)
[ Upstream commit 31bf77dcc3810e08bcc7d15470e92cdfffb7f7f1 ]

net_iov / freelist / etc. arrays can be quite long, make sure they're
accounted.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
io_uring/zcrx.c

index 23ffc95caa4279bfdab200bb2026f795c0520ff9..e3953ea740c03bd1a54ec06ebd7efeed7552a61c 100644 (file)
@@ -426,17 +426,17 @@ static int io_zcrx_create_area(struct io_zcrx_ifq *ifq,
 
        ret = -ENOMEM;
        area->nia.niovs = kvmalloc_array(nr_iovs, sizeof(area->nia.niovs[0]),
-                                        GFP_KERNEL | __GFP_ZERO);
+                                        GFP_KERNEL_ACCOUNT | __GFP_ZERO);
        if (!area->nia.niovs)
                goto err;
 
        area->freelist = kvmalloc_array(nr_iovs, sizeof(area->freelist[0]),
-                                       GFP_KERNEL | __GFP_ZERO);
+                                       GFP_KERNEL_ACCOUNT | __GFP_ZERO);
        if (!area->freelist)
                goto err;
 
        area->user_refs = kvmalloc_array(nr_iovs, sizeof(area->user_refs[0]),
-                                       GFP_KERNEL | __GFP_ZERO);
+                                       GFP_KERNEL_ACCOUNT | __GFP_ZERO);
        if (!area->user_refs)
                goto err;