mm, memcg: make memory.emin the baseline for utilisation determination
[linux-2.6-microblaze.git] / include / linux / memcontrol.h
index fa9ba2e..1cbad12 100644 (file)
@@ -356,12 +356,17 @@ static inline bool mem_cgroup_disabled(void)
        return !cgroup_subsys_enabled(memory_cgrp_subsys);
 }
 
-static inline unsigned long mem_cgroup_protection(struct mem_cgroup *memcg)
+static inline void mem_cgroup_protection(struct mem_cgroup *memcg,
+                                        unsigned long *min, unsigned long *low)
 {
-       if (mem_cgroup_disabled())
-               return 0;
+       if (mem_cgroup_disabled()) {
+               *min = 0;
+               *low = 0;
+               return;
+       }
 
-       return max(READ_ONCE(memcg->memory.emin), READ_ONCE(memcg->memory.elow));
+       *min = READ_ONCE(memcg->memory.emin);
+       *low = READ_ONCE(memcg->memory.elow);
 }
 
 enum mem_cgroup_protection mem_cgroup_protected(struct mem_cgroup *root,
@@ -839,9 +844,11 @@ static inline void memcg_memory_event_mm(struct mm_struct *mm,
 {
 }
 
-static inline unsigned long mem_cgroup_protection(struct mem_cgroup *memcg)
+static inline void mem_cgroup_protection(struct mem_cgroup *memcg,
+                                        unsigned long *min, unsigned long *low)
 {
-       return 0;
+       *min = 0;
+       *low = 0;
 }
 
 static inline enum mem_cgroup_protection mem_cgroup_protected(