diff options
author | Kyle McMartin <kyle@mcmartin.ca> | 2010-11-29 21:07:53 -0500 |
---|---|---|
committer | Kyle McMartin <kyle@mcmartin.ca> | 2010-11-29 21:07:53 -0500 |
commit | 311bf8c0a909df19d46199a82607382d27fa48e8 (patch) | |
tree | 84308fad52a9163b5dd984f51afde07af65684ae /linux-2.6-debug-vm-would-have-oomkilled.patch | |
parent | ed1195f0f7adad86cb7bef6b78e87e32a93e2e4c (diff) | |
download | kernel-311bf8c0a909df19d46199a82607382d27fa48e8.tar.gz kernel-311bf8c0a909df19d46199a82607382d27fa48e8.tar.xz kernel-311bf8c0a909df19d46199a82607382d27fa48e8.zip |
un-rebase drm-intel-big-hammer & make-lvds-work, update would_have_oomkilled
Diffstat (limited to 'linux-2.6-debug-vm-would-have-oomkilled.patch')
-rw-r--r-- | linux-2.6-debug-vm-would-have-oomkilled.patch | 69 |
1 files changed, 37 insertions, 32 deletions
diff --git a/linux-2.6-debug-vm-would-have-oomkilled.patch b/linux-2.6-debug-vm-would-have-oomkilled.patch index dd8ba3f0a..8bd05ab06 100644 --- a/linux-2.6-debug-vm-would-have-oomkilled.patch +++ b/linux-2.6-debug-vm-would-have-oomkilled.patch @@ -1,26 +1,30 @@ -From 03657519851cd180983db4bd0c38eaeed4aa2962 Mon Sep 17 00:00:00 2001 -From: Kyle McMartin <kyle@treachery.i.jkkm.org> -Date: Mon, 11 Jan 2010 08:25:12 -0500 -Subject: linux-2.6-debug-vm-would-have-oomkilled.patch +From beb764ac03e52eba1a654afb4273fab1f9de3cff Mon Sep 17 00:00:00 2001 +From: Kyle McMartin <kyle@mcmartin.ca> +Date: Mon, 29 Nov 2010 20:59:14 -0500 +Subject: [PATCH] linux-2.6-debug-vm-would_have_oomkilled --- - kernel/sysctl.c | 8 ++++++++ - mm/oom_kill.c | 7 +++++++ - 2 files changed, 15 insertions(+), 0 deletions(-) + include/linux/oom.h | 1 + + kernel/sysctl.c | 7 +++++++ + mm/oom_kill.c | 8 ++++++++ + 3 files changed, 16 insertions(+), 0 deletions(-) +diff --git a/include/linux/oom.h b/include/linux/oom.h +index 5e3aa83..79a27b4 100644 +--- a/include/linux/oom.h ++++ b/include/linux/oom.h +@@ -72,5 +72,6 @@ extern struct task_struct *find_lock_task_mm(struct task_struct *p); + extern int sysctl_oom_dump_tasks; + extern int sysctl_oom_kill_allocating_task; + extern int sysctl_panic_on_oom; ++extern int sysctl_would_have_oomkilled; + #endif /* __KERNEL__*/ + #endif /* _INCLUDE_LINUX_OOM_H */ diff --git a/kernel/sysctl.c b/kernel/sysctl.c -index 8a68b24..72a4ff1 100644 +index 5abfa15..a0fed6d 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c -@@ -71,6 +71,7 @@ extern int sysctl_overcommit_ratio; - extern int sysctl_panic_on_oom; - extern int sysctl_oom_kill_allocating_task; - extern int sysctl_oom_dump_tasks; -+extern int sysctl_would_have_oomkilled; - extern int max_threads; - extern int core_uses_pid; - extern int suid_dumpable; -@@ -973,6 +974,13 @@ static struct ctl_table vm_table[] = { +@@ -1000,6 +1000,13 @@ static struct ctl_table vm_table[] = { .proc_handler = proc_dointvec, }, { @@ -28,37 +32,38 @@ index 8a68b24..72a4ff1 100644 + .data = &sysctl_would_have_oomkilled, + .maxlen = sizeof(sysctl_would_have_oomkilled), + .mode = 0644, -+ .proc_handler = &proc_dointvec, ++ .proc_handler = proc_dointvec, + }, + { .procname = "overcommit_ratio", .data = &sysctl_overcommit_ratio, .maxlen = sizeof(sysctl_overcommit_ratio), diff --git a/mm/oom_kill.c b/mm/oom_kill.c -index f52481b..a892f07 100644 +index 7dcca55..281ac39 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c -@@ -31,6 +31,7 @@ +@@ -35,6 +35,7 @@ int sysctl_panic_on_oom; int sysctl_oom_kill_allocating_task; - int sysctl_oom_dump_tasks; + int sysctl_oom_dump_tasks = 1; +int sysctl_would_have_oomkilled; static DEFINE_SPINLOCK(zone_scan_lock); - /* #define DEBUG */ -@@ -396,6 +397,12 @@ static void __oom_kill_task(struct task_struct *p, int verbose) - return; + #ifdef CONFIG_NUMA +@@ -477,6 +478,13 @@ static int oom_kill_process(struct task_struct *p, gfp_t gfp_mask, int order, } -+ if (sysctl_would_have_oomkilled == 1) { -+ printk(KERN_ERR "Would have killed process %d (%s). But continuing instead.\n", -+ task_pid_nr(p), p->comm); -+ return; + task_lock(p); ++ if (sysctl_would_have_oomkilled) { ++ printk(KERN_ERR "%s: would have killed process %d (%s), but continuing instead...\n", ++ __func__, task_pid_nr(p), p->comm); ++ task_unlock(p); ++ return 0; + } + - if (verbose) - printk(KERN_ERR "Killed process %d (%s) " - "vsz:%lukB, anon-rss:%lukB, file-rss:%lukB\n", + pr_err("%s: Kill process %d (%s) score %d or sacrifice child\n", + message, task_pid_nr(p), p->comm, points); + task_unlock(p); -- -1.6.5.2 +1.7.3.2 |