[Devel] [PATCH RHEL7 COMMIT] mm/vmalloc: do not account vmap_area to memcg

Konstantin Khorenko khorenko at odin.com
Mon May 18 06:09:37 PDT 2015


The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.5.1
------>
commit e4ba5fef962e96b36f0672ef239b5ec56cc8821a
Author: Vladimir Davydov <vdavydov at parallels.com>
Date:   Mon May 18 17:09:37 2015 +0400

    mm/vmalloc: do not account vmap_area to memcg
    
    To avoid frequent TLB flushes, vmap_area structs are freed lazily, in
    batches, once there are enough of them hanging around. As a result,
    accounting them to a memcg pins the memcg itself and its kmem caches for
    indefinitely long, which is not good. To avoid this, this patch makes
    allocations of vmap_area's go through the root cgroup. Since they are
    small and there cannot be many of them, not accounting them to memcg
    won't open any security holes.
    
    Signed-off-by: Vladimir Davydov <vdavydov at parallels.com>
---
 mm/vmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 06a4446..ac32dca 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -357,7 +357,7 @@ static struct vmap_area *alloc_vmap_area(unsigned long size,
 	BUG_ON(!is_power_of_2(align));
 
 	va = kmalloc_node(sizeof(struct vmap_area),
-			gfp_mask & GFP_RECLAIM_MASK, node);
+			(gfp_mask & GFP_RECLAIM_MASK) | __GFP_NOACCOUNT, node);
 	if (unlikely(!va))
 		return ERR_PTR(-ENOMEM);
 



More information about the Devel mailing list