[PATCH 2/5] fs: charge pipe buffers to memcg

From: Vladimir Davydov
Date: Sat Sep 26 2015 - 06:47:40 EST


Pipe buffers can be generated unrestrictedly by an unprivileged
userspace process, so they shouldn't go unaccounted.

Signed-off-by: Vladimir Davydov <vdavydov@xxxxxxxxxxxxx>
---
fs/pipe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/pipe.c b/fs/pipe.c
index 8865f7963700..6880884b70b0 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -400,7 +400,7 @@ pipe_write(struct kiocb *iocb, struct iov_iter *from)
int copied;

if (!page) {
- page = alloc_page(GFP_HIGHUSER);
+ page = alloc_kmem_pages(GFP_HIGHUSER, 0);
if (unlikely(!page)) {
ret = ret ? : -ENOMEM;
break;
--
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/