lkml.org 
[lkml]   [2001]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectOOM killer ultimate patch...

Hi

here's the patch that will solve all OOM killer problems out
there...someone had to do it.

Jani.

--- linux/mm/oom_kill.c.orig Fri Mar 30 11:06:24 2001
+++ linux/mm/oom_kill.c Fri Mar 30 14:49:56 2001
@@ -147,6 +147,16 @@
* CAP_SYS_RAW_IO set, send SIGTERM instead (but it's unlikely that
* we select a process with CAP_SYS_RAW_IO set).
*/
+
+/*
+ * Even if these new signals are not (yet) required by SuS or POSIX ,
+ * Linux should be able to handle them...
+ * PIGTERM and PIGKILL are similar to SIGTERM and SIGKILL.The difference is that they are
+ * only sent to memory hogs, hence their name.
+ */
+#define PIGTERM SIGTERM
+#define PIGKILL SIGKILL
+
void oom_kill(void)
{

@@ -168,9 +178,9 @@

/* This process has hardware access, be more careful. */
if (cap_t(p->cap_effective) & CAP_TO_MASK(CAP_SYS_RAWIO)) {
- force_sig(SIGTERM, p);
+ force_sig(PIGTERM, p);
} else {
- force_sig(SIGKILL, p);
+ force_sig(PIGKILL, p);
}

/*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:21    [W:0.028 / U:2.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site