aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorDavid Rientjes <rientjes@google.com>2008-02-07 03:14:07 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 11:42:19 -0500
commitfef1bdd68c81b71882ccb6f47c70980a03182063 (patch)
tree4cfa5c2c10787a3d54de05ca511db31730a239fd /kernel
parent4c4a22148909e4c003562ea7ffe0a06e26919e3c (diff)
oom: add sysctl to enable task memory dump
Adds a new sysctl, 'oom_dump_tasks', that enables the kernel to produce a dump of all system tasks (excluding kernel threads) when performing an OOM-killing. Information includes pid, uid, tgid, vm size, rss, cpu, oom_adj score, and name. This is helpful for determining why there was an OOM condition and which rogue task caused it. It is configurable so that large systems, such as those with several thousand tasks, do not incur a performance penalty associated with dumping data they may not desire. If an OOM was triggered as a result of a memory controller, the tasklist shall be filtered to exclude tasks that are not a member of the same cgroup. Cc: Andrea Arcangeli <andrea@suse.de> Cc: Christoph Lameter <clameter@sgi.com> Cc: Balbir Singh <balbir@linux.vnet.ibm.com> Signed-off-by: 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 'kernel')
-rw-r--r--kernel/sysctl.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 86daaa26d120..8c98d8147d88 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -67,6 +67,7 @@ extern int sysctl_overcommit_memory;
67extern int sysctl_overcommit_ratio; 67extern int sysctl_overcommit_ratio;
68extern int sysctl_panic_on_oom; 68extern int sysctl_panic_on_oom;
69extern int sysctl_oom_kill_allocating_task; 69extern int sysctl_oom_kill_allocating_task;
70extern int sysctl_oom_dump_tasks;
70extern int max_threads; 71extern int max_threads;
71extern int core_uses_pid; 72extern int core_uses_pid;
72extern int suid_dumpable; 73extern int suid_dumpable;
@@ -871,6 +872,14 @@ static struct ctl_table vm_table[] = {
871 .proc_handler = &proc_dointvec, 872 .proc_handler = &proc_dointvec,
872 }, 873 },
873 { 874 {
875 .ctl_name = CTL_UNNUMBERED,
876 .procname = "oom_dump_tasks",
877 .data = &sysctl_oom_dump_tasks,
878 .maxlen = sizeof(sysctl_oom_dump_tasks),
879 .mode = 0644,
880 .proc_handler = &proc_dointvec,
881 },
882 {
874 .ctl_name = VM_OVERCOMMIT_RATIO, 883 .ctl_name = VM_OVERCOMMIT_RATIO,
875 .procname = "overcommit_ratio", 884 .procname = "overcommit_ratio",
876 .data = &sysctl_overcommit_ratio, 885 .data = &sysctl_overcommit_ratio,