]> git.baikalelectronics.ru Git - kernel.git/commit
memcg: fix hierarchical oom locking
authorJohannes Weiner <jweiner@redhat.com>
Thu, 25 Aug 2011 22:59:16 +0000 (15:59 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 25 Aug 2011 23:25:34 +0000 (16:25 -0700)
commit1c6affd25b775cbf3f581d5663539c1462d84e6f
tree30c33d9165bb33d64bd42d6e9bc1e4cbed1c0780
parentdc10c9ed15cf135c1d9b9b38af9a00ca6a71d07a
memcg: fix hierarchical oom locking

Commit 54b35c586383 ("memcg: make oom_lock 0 and 1 based rather than
counter") tried to oom lock the hierarchy and roll back upon
encountering an already locked memcg.

The code is confused when it comes to detecting a locked memcg, though,
so it would fail and rollback after locking one memcg and encountering
an unlocked second one.

The result is that oom-locking hierarchies fails unconditionally and
that every oom killer invocation simply goes to sleep on the oom
waitqueue forever.  The tasks practically hang forever without anyone
intervening, possibly holding locks that trip up unrelated tasks, too.

Signed-off-by: Johannes Weiner <jweiner@redhat.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memcontrol.c