From: Jens Axboe Date: Fri, 24 Sep 2021 13:39:08 +0000 (-0600) Subject: io_uring: put provided buffer meta data under memcg accounting X-Git-Tag: accepted/tizen/unified/20230118.172025~6138^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9990da93d2bf9892c2c14c958bef050d4e461a1a;p=platform%2Fkernel%2Flinux-rpi.git 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: ddf0322db79c ("io_uring: add IORING_OP_PROVIDE_BUFFERS") Signed-off-by: Jens Axboe --- diff --git a/fs/io_uring.c b/fs/io_uring.c index ef3c94a..01e49d0 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -4387,7 +4387,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;