OOM killer ultimate patch...

From: Jani Monoses (jani@virtualro.ic.ro)
Date: Fri Mar 30 2001 - 08:00:02 EST


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/



This archive was generated by hypermail 2b29 : Sat Mar 31 2001 - 21:00:23 EST