memcg: simplify unreclaimable groups handling in soft limit reclaim
authorVladimir Davydov <vdavydov@parallels.com>
Wed, 10 Dec 2014 23:43:40 +0000 (15:43 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 11 Dec 2014 01:41:06 +0000 (17:41 -0800)
commitbc2f2e7ffe5b6292c74ee1206d6ca303e13886b2
treeb1282dbc1b6f76da3e48ba8b6ba785b51159e5ec
parent6f7c97e80b813879a17c0e8ef343cc414761e6f5
memcg: simplify unreclaimable groups handling in soft limit reclaim

If we fail to reclaim anything from a cgroup during a soft reclaim pass
we want to get the next largest cgroup exceeding its soft limit. To
achieve this, we should obviously remove the current group from the tree
and then pick the largest group. Currently we have a weird loop instead.
Let's simplify it.

Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memcontrol.c