Skip to content

Commit 9672e0b

Browse files
isilencegregkh
authored andcommitted
io_uring/kbuf: account ring io_buffer_list memory
Commit 475a8d30371604a6363da8e304a608a5959afc40 upstream. 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 pin user memory or allocate it, which is already accounted. Cc: [email protected] # 6.1 Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/3985218b50d341273cafff7234e1a7e6d0db9808.1747150490.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d85473b commit 9672e0b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io_uring/kbuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ int io_register_pbuf_ring(struct io_ring_ctx *ctx, void __user *arg)
510510
if (bl->buf_nr_pages || !list_empty(&bl->buf_list))
511511
return -EEXIST;
512512
} else {
513-
free_bl = bl = kzalloc(sizeof(*bl), GFP_KERNEL);
513+
free_bl = bl = kzalloc(sizeof(*bl), GFP_KERNEL_ACCOUNT);
514514
if (!bl)
515515
return -ENOMEM;
516516
}

0 commit comments

Comments
 (0)