]> git.baikalelectronics.ru Git - kernel.git/commit
memcg: fix wake up in oom wait queue
authorKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Tue, 29 Jun 2010 22:05:18 +0000 (15:05 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 29 Jun 2010 22:29:30 +0000 (15:29 -0700)
commit9cc22a2c394f17d9b6ae26158f37b2fe398d7c08
treed137f9220a1572c2e3b53ce38950314f5aeb82e4
parentc56087b2d81b9c54c909ab50980f6cfcb4256d51
memcg: fix wake up in oom wait queue

OOM-waitqueue should be waken up when oom_disable is canceled.  This is a
fix for 67ffbfdc9edbc21b ("memcg: oom kill disable and oom status").

How to test:
 Create a cgroup A...
 1. set memory.limit and memory.memsw.limit to be small value
 2. echo 1 > /cgroup/A/memory.oom_control, this disables oom-kill.
 3. run a program which must cause OOM.

A program executed in 3 will sleep by oom_waiqueue in memcg.  Then, how to
wake it up is problem.

 1. echo 0 > /cgroup/A/memory.oom_control (enable OOM-killer)
 2. echo big mem > /cgroup/A/memory.memsw.limit_in_bytes(allow more swap)

etc..

Without the patch, a task in slept can not be waken up.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Balbir Singh <balbir@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memcontrol.c