Commit 9990da93 authored by Jens Axboe's avatar Jens Axboe

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: ddf0322d ("io_uring: add IORING_OP_PROVIDE_BUFFERS")
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 8bab4c09
...@@ -4387,7 +4387,7 @@ static int io_add_buffers(struct io_provide_buf *pbuf, struct io_buffer **head) ...@@ -4387,7 +4387,7 @@ static int io_add_buffers(struct io_provide_buf *pbuf, struct io_buffer **head)
int i, bid = pbuf->bid; int i, bid = pbuf->bid;
for (i = 0; i < pbuf->nbufs; i++) { for (i = 0; i < pbuf->nbufs; i++) {
buf = kmalloc(sizeof(*buf), GFP_KERNEL); buf = kmalloc(sizeof(*buf), GFP_KERNEL_ACCOUNT);
if (!buf) if (!buf)
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment