vmscan: do not unconditionally treat zones that fail zone_reclaim() as full
[safe/jmp/linux-2.6] / mm / memcontrol.c
index 4a747a2..70db6e0 100644 (file)
@@ -314,14 +314,6 @@ static struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm)
        return mem;
 }
 
-static bool mem_cgroup_is_obsolete(struct mem_cgroup *mem)
-{
-       if (!mem)
-               return true;
-       return css_is_removed(&mem->css);
-}
-
-
 /*
  * Call callback function against all cgroup under hierarchy tree.
  */
@@ -578,6 +570,17 @@ int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg)
        return 0;
 }
 
+int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg)
+{
+       unsigned long active;
+       unsigned long inactive;
+
+       inactive = mem_cgroup_get_local_zonestat(memcg, LRU_INACTIVE_FILE);
+       active = mem_cgroup_get_local_zonestat(memcg, LRU_ACTIVE_FILE);
+
+       return (active > inactive);
+}
+
 unsigned long mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg,
                                       struct zone *zone,
                                       enum lru_list lru)
@@ -932,7 +935,7 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm,
        if (unlikely(!mem))
                return 0;
 
-       VM_BUG_ON(!mem || mem_cgroup_is_obsolete(mem));
+       VM_BUG_ON(css_is_removed(&mem->css));
 
        while (1) {
                int ret;