Messages in this thread Patch in this message | | | Date | Tue, 16 Mar 2010 15:08:51 +0100 | Subject | [PATCH] oom_kill: set default process to kill | From | Bob Sleigh <> |
| |
--- mm/Kconfig | 9 +++++++++ mm/oom_kill.c | 10 ++++++++++ 2 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/mm/Kconfig b/mm/Kconfig index 9c61158..3911730 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -287,3 +287,12 @@ config NOMMU_INITIAL_TRIM_EXCESS of 1 says that all excess pages should be trimmed.
See Documentation/nommu-mmap.txt for more information. + +config MM_USUAL_SUSPECT + string "Default executable name to be killed by the OOM killer" + default "" + help + This option sets the default executable name to be killed when we run + out of memory. + + If unsure, set to "firefox-bin". diff --git a/mm/oom_kill.c b/mm/oom_kill.c index 35755a4..333fa46 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c @@ -300,6 +300,16 @@ static struct task_struct *select_bad_process(unsigned long *ppoints, if (p->signal->oom_adj == OOM_DISABLE) continue;
+#ifdef CONFIG_MM_USUAL_SUSPECT + /* + * Select the task if matching the usual suspect. + */ + if (strcmp(p->comm, CONFIG_MM_USUAL_SUSPECT)) { + chosen = p; + continue; + } +#endif + points = badness(p, uptime.tv_sec); if (points > *ppoints || !chosen) { chosen = p;
| |