diff options
author | KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> | 2010-05-26 17:42:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 12:12:43 -0400 |
commit | 3c11ecf448eff8f12922c498b8274ce98587eb74 (patch) | |
tree | 0a28aeef7759ead93ff58fd7db2fe61797523f7e /Documentation/cgroups | |
parent | 9490ff275606da012d5b373342a49610ad61cb81 (diff) |
memcg: oom kill disable and oom status
This adds a feature to disable oom-killer for memcg, if disabled, of
course, tasks under memcg will stop.
But now, we have oom-notifier for memcg. And the world around memcg is
not under out-of-memory. memcg's out-of-memory just shows memcg hits
limit. Then, administrator or management daemon can recover the situation
by
- kill some process
- enlarge limit, add more swap.
- migrate some tasks
- remove file cache on tmps (difficult ?)
Unlike oom-killer, you can take enough information before killing tasks.
(by gcore, or, ps etc.)
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Balbir Singh <balbir@in.ibm.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/cgroups')
-rw-r--r-- | Documentation/cgroups/memory.txt | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index eac22d3b2f7b..44e7ded33448 100644 --- a/Documentation/cgroups/memory.txt +++ b/Documentation/cgroups/memory.txt | |||
@@ -493,6 +493,8 @@ It's applicable for root and non-root cgroup. | |||
493 | 493 | ||
494 | 10. OOM Control | 494 | 10. OOM Control |
495 | 495 | ||
496 | memory.oom_control file is for OOM notification and other controls. | ||
497 | |||
496 | Memory controler implements oom notifier using cgroup notification | 498 | Memory controler implements oom notifier using cgroup notification |
497 | API (See cgroups.txt). It allows to register multiple oom notification | 499 | API (See cgroups.txt). It allows to register multiple oom notification |
498 | delivery and gets notification when oom happens. | 500 | delivery and gets notification when oom happens. |
@@ -505,6 +507,27 @@ To register a notifier, application need: | |||
505 | Application will be notifier through eventfd when oom happens. | 507 | Application will be notifier through eventfd when oom happens. |
506 | OOM notification doesn't work for root cgroup. | 508 | OOM notification doesn't work for root cgroup. |
507 | 509 | ||
510 | You can disable oom-killer by writing "1" to memory.oom_control file. | ||
511 | As. | ||
512 | #echo 1 > memory.oom_control | ||
513 | |||
514 | This operation is only allowed to the top cgroup of subhierarchy. | ||
515 | If oom-killer is disabled, tasks under cgroup will hang/sleep | ||
516 | in memcg's oom-waitq when they request accountable memory. | ||
517 | |||
518 | For running them, you have to relax the memcg's oom sitaution by | ||
519 | * enlarge limit or reduce usage. | ||
520 | To reduce usage, | ||
521 | * kill some tasks. | ||
522 | * move some tasks to other group with account migration. | ||
523 | * remove some files (on tmpfs?) | ||
524 | |||
525 | Then, stopped tasks will work again. | ||
526 | |||
527 | At reading, current status of OOM is shown. | ||
528 | oom_kill_disable 0 or 1 (if 1, oom-killer is disabled) | ||
529 | under_oom 0 or 1 (if 1, the memcg is under OOM,tasks may | ||
530 | be stopped.) | ||
508 | 531 | ||
509 | 11. TODO | 532 | 11. TODO |
510 | 533 | ||