Skip to content

Commit 9990da9

Browse files
committed
io_uring: put provided buffer meta data under memcg accounting
For each provided buffer, we allocate a struct io_buffer to hold the data associated with it. As a large number of buffers can be provided, account that data with memcg. Fixes: ddf0322 ("io_uring: add IORING_OP_PROVIDE_BUFFERS") Signed-off-by: Jens Axboe <[email protected]>
1 parent 8bab4c0 commit 9990da9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4387,7 +4387,7 @@ static int io_add_buffers(struct io_provide_buf *pbuf, struct io_buffer **head)
43874387
int i, bid = pbuf->bid;
43884388

43894389
for (i = 0; i < pbuf->nbufs; i++) {
4390-
buf = kmalloc(sizeof(*buf), GFP_KERNEL);
4390+
buf = kmalloc(sizeof(*buf), GFP_KERNEL_ACCOUNT);
43914391
if (!buf)
43924392
break;
43934393

0 commit comments

Comments
 (0)