tree b7f190f47de0c2c6ea28ea75d8211fb54c0a0e31
parent 92da84908dea84ebe88f551edc8ffc8b807680de
author Andrea Arcangeli <[EMAIL PROTECTED]> Tue Apr 12 08:24:41 2005
committer Linus Torvalds <[EMAIL PROTECTED]> Tue Apr 12 08:24:41 2005

[PATCH] oom-killer disable for iscsi/lvm2/multipath userland critical sections

iscsi/lvm2/multipath needs guaranteed protection from the oom-killer, so
make the magical value of -17 in /proc/<pid>/oom_adj defeat the oom-killer
altogether.

(akpm: we still need to document oom_adj and friends in
Documentation/filesystems/proc.txt!)

Signed-off-by: Andrea Arcangeli <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 fs/proc/base.c     |    2 +-
 include/linux/mm.h |    3 +++
 mm/oom_kill.c      |    2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

Index: fs/proc/base.c
===================================================================
--- ce0c1d8c68f6f28166d42a34ef9c09294cdc0065/fs/proc/base.c  (mode:100644 
sha1:73cbccf8792c4e2c2f80bfdbd0938c67aa58ec7d)
+++ b7f190f47de0c2c6ea28ea75d8211fb54c0a0e31/fs/proc/base.c  (mode:100644 
sha1:65a19740414860c2912671d500b49cb696853f57)
@@ -751,7 +751,7 @@
        if (copy_from_user(buffer, buf, count))
                return -EFAULT;
        oom_adjust = simple_strtol(buffer, &end, 0);
-       if (oom_adjust < -16 || oom_adjust > 15)
+       if ((oom_adjust < -16 || oom_adjust > 15) && oom_adjust != OOM_DISABLE)
                return -EINVAL;
        if (*end == '\n')
                end++;
Index: include/linux/mm.h
===================================================================
--- ce0c1d8c68f6f28166d42a34ef9c09294cdc0065/include/linux/mm.h  (mode:100644 
sha1:c2d469e38b9662cd43f9e24ba457ad4a78925a7e)
+++ b7f190f47de0c2c6ea28ea75d8211fb54c0a0e31/include/linux/mm.h  (mode:100644 
sha1:f8d49cd524095c0acf3ff462a1280a28bccafb58)
@@ -857,5 +857,8 @@
 #define in_gate_area(task, addr) ({(void)task; in_gate_area_no_task(addr);})
 #endif /* __HAVE_ARCH_GATE_AREA */
 
+/* /proc/<pid>/oom_adj set to -17 protects from the oom-killer */
+#define OOM_DISABLE -17
+
 #endif /* __KERNEL__ */
 #endif /* _LINUX_MM_H */
Index: mm/oom_kill.c
===================================================================
--- ce0c1d8c68f6f28166d42a34ef9c09294cdc0065/mm/oom_kill.c  (mode:100644 
sha1:d722de8a2e251b9146c5171f0c85c33da0aadc8f)
+++ b7f190f47de0c2c6ea28ea75d8211fb54c0a0e31/mm/oom_kill.c  (mode:100644 
sha1:f0e4346a9a994c2016309b7454464f0cad9ae590)
@@ -145,7 +145,7 @@
        do_posix_clock_monotonic_gettime(&uptime);
        do_each_thread(g, p)
                /* skip the init task with pid == 1 */
-               if (p->pid > 1) {
+               if (p->pid > 1 && p->oomkilladj != OOM_DISABLE) {
                        unsigned long points;
 
                        /*
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to