Skip to contentSkip to conversation

io_uring: put provided buffer meta data under memcg accounting

PATCH New Jens Axboe 1 participant 1 message Sep 24, 2021

Subsystems (2)
lore
Share & tools
lore

Jens Axboe

author maintainer
#0 lore raw

PATCH 1/1 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")

---

fs/io_uring.c +1 -1
index 056418f67ef6..67a6f5666965 100644
@@ -4351,7 +4351,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;
 
Signature · 1 line
Jens Axboe