lkml.org 
[lkml]   [2012]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH v3 19/21] memcg: check lru vectors emptiness in pre-destroy
From
Date
We must abort cgroup destroying if it still not empty,
resource counter cannot catch isolated uncharged pages.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
---
mm/memcontrol.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 4de8044..fbeff85 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4859,8 +4859,16 @@ free_out:
static int mem_cgroup_pre_destroy(struct cgroup *cont)
{
struct mem_cgroup *memcg = mem_cgroup_from_cont(cont);
+ int ret;
+
+ ret = mem_cgroup_force_empty(memcg, false);
+ if (ret)
+ return ret;

- return mem_cgroup_force_empty(memcg, false);
+ if (mem_cgroup_nr_lru_pages(memcg, -1))
+ return -EBUSY;
+
+ return 0;
}

static void mem_cgroup_destroy(struct cgroup *cont)


\
 
 \ /
  Last update: 2012-02-23 15:07    [from the cache]
©2003-2011 Jasper Spaans