lkml.org 
[lkml]   [2015]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/5] fs: charge pipe buffers to memcg
Date
Pipe buffers can be generated unrestrictedly by an unprivileged
userspace process, so they shouldn't go unaccounted.

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
---
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


\
 
 \ /
  Last update: 2015-09-26 13:01    [W:0.099 / U:2.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site