summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-09-24 16:39:08 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-09-30 11:13:03 +0300
commit05ac8e4c8aec533a276d92d4246b8bad19529831 (patch)
treecedc0af2e5eb0c047139fc82ea564ff1e273639e
parent24d38dcce407cc6c2e76efd127a27db89cf26203 (diff)
downloadlinux-05ac8e4c8aec533a276d92d4246b8bad19529831.tar.xz
io_uring: put provided buffer meta data under memcg accounting
[ Upstream commit 9990da93d2bf9892c2c14c958bef050d4e461a1a ] 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: ddf0322db79c ("io_uring: add IORING_OP_PROVIDE_BUFFERS") Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--fs/io_uring.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 739e58ccc982..187eb1907bde 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -4043,7 +4043,7 @@ static int io_add_buffers(struct io_provide_buf *pbuf, struct io_buffer **head)
int i, bid = pbuf->bid;
for (i = 0; i < pbuf->nbufs; i++) {
- buf = kmalloc(sizeof(*buf), GFP_KERNEL);
+ buf = kmalloc(sizeof(*buf), GFP_KERNEL_ACCOUNT);
if (!buf)
break;