diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 3a628435f36a826a82e34cb037a60a483c1ec19e..975207a9cc65581fb0bcae9782db7229b0941f5a 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3518,34 +3518,16 @@ unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order, nr_reclaimed += reclaimed; *total_scanned += nr_scanned; spin_lock_irq(&mctz->lock); + __mem_cgroup_remove_exceeded(mz, mctz); /* * If we failed to reclaim anything from this memory cgroup * it is time to move on to the next cgroup */ next_mz = NULL; - if (!reclaimed) { - do { - /* - * Loop until we find yet another one. - * - * By the time we get the soft_limit lock - * again, someone might have aded the - * group back on the RB tree. Iterate to - * make sure we get a different mem. - * mem_cgroup_largest_soft_limit_node returns - * NULL if no other cgroup is present on - * the tree - */ - next_mz = - __mem_cgroup_largest_soft_limit_node(mctz); - if (next_mz == mz) - css_put(&next_mz->memcg->css); - else /* next_mz == NULL or other memcg */ - break; - } while (1); - } - __mem_cgroup_remove_exceeded(mz, mctz); + if (!reclaimed) + next_mz = __mem_cgroup_largest_soft_limit_node(mctz); + excess = soft_limit_excess(mz->memcg); /* * One school of thought says that we should not add