- oom-killer-meets-userspace-headers.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     OOM killer meets userspace headers
has been removed from the -mm tree.  Its filename was
     oom-killer-meets-userspace-headers.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
Subject: OOM killer meets userspace headers
From: Alexey Dobriyan <adobriyan@xxxxxxxxx>

Despite mm.h is not being exported header, it does contain one thing
which is part of userspace ABI -- value disabling OOM killer for given
process. So,
a) create and export include/linux/oom.h
b) move OOM_DISABLE define there.
c) turn bounding values of /proc/$PID/oom_adj into defines and export
   them too.

Note: mass __KERNEL__ removal will be done later.

Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>
Cc: Nick Piggin <nickpiggin@xxxxxxxxxxxx>
Cc: David Woodhouse <dwmw2@xxxxxxxxxxxxx>
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 fs/proc/base.c       |    4 +++-
 include/linux/Kbuild |    1 +
 include/linux/mm.h   |    3 ---
 include/linux/oom.h  |   10 ++++++++++
 mm/oom_kill.c        |    1 +
 5 files changed, 15 insertions(+), 4 deletions(-)

diff -puN fs/proc/base.c~oom-killer-meets-userspace-headers fs/proc/base.c
--- a/fs/proc/base.c~oom-killer-meets-userspace-headers
+++ a/fs/proc/base.c
@@ -72,6 +72,7 @@
 #include <linux/audit.h>
 #include <linux/poll.h>
 #include <linux/nsproxy.h>
+#include <linux/oom.h>
 #include "internal.h"
 
 /* NOTE:
@@ -689,7 +690,8 @@ static ssize_t oom_adjust_write(struct f
 	if (copy_from_user(buffer, buf, count))
 		return -EFAULT;
 	oom_adjust = simple_strtol(buffer, &end, 0);
-	if ((oom_adjust < -16 || oom_adjust > 15) && oom_adjust != OOM_DISABLE)
+	if ((oom_adjust < OOM_ADJUST_MIN || oom_adjust > OOM_ADJUST_MAX) &&
+	     oom_adjust != OOM_DISABLE)
 		return -EINVAL;
 	if (*end == '\n')
 		end++;
diff -puN include/linux/Kbuild~oom-killer-meets-userspace-headers include/linux/Kbuild
--- a/include/linux/Kbuild~oom-killer-meets-userspace-headers
+++ a/include/linux/Kbuild
@@ -120,6 +120,7 @@ header-y += netrom.h
 header-y += nfs2.h
 header-y += nfs4_mount.h
 header-y += nfs_mount.h
+header-y += oom.h
 header-y += param.h
 header-y += pci_ids.h
 header-y += pci_regs.h
diff -puN include/linux/mm.h~oom-killer-meets-userspace-headers include/linux/mm.h
--- a/include/linux/mm.h~oom-killer-meets-userspace-headers
+++ a/include/linux/mm.h
@@ -1115,9 +1115,6 @@ int in_gate_area_no_task(unsigned long a
 #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
-
 int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *,
 					void __user *, size_t *, loff_t *);
 unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask,
diff -puN /dev/null include/linux/oom.h
--- /dev/null
+++ a/include/linux/oom.h
@@ -0,0 +1,10 @@
+#ifndef __INCLUDE_LINUX_OOM_H
+#define __INCLUDE_LINUX_OOM_H
+
+/* /proc/<pid>/oom_adj set to -17 protects from the oom-killer */
+#define OOM_DISABLE (-17)
+/* inclusive */
+#define OOM_ADJUST_MIN (-16)
+#define OOM_ADJUST_MAX 15
+
+#endif
diff -puN mm/oom_kill.c~oom-killer-meets-userspace-headers mm/oom_kill.c
--- a/mm/oom_kill.c~oom-killer-meets-userspace-headers
+++ a/mm/oom_kill.c
@@ -15,6 +15,7 @@
  *  kernel subsystems and hints as to where to find out what things do.
  */
 
+#include <linux/oom.h>
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/swap.h>
_

Patches currently in -mm which might be from adobriyan@xxxxxxxxx are

origin.patch
i2o-exec-osmc-use-unsigned-long-flags.patch
mtd-fix-comment-typo-devic.patch
parisc-use-unsigned-long-flags-in-semaphore-code.patch
config_pm=n-slim-drivers-pcmcia.patch
i82092-wire-up-errors-from-pci_register_driver.patch
megaraid-fix-warnings-when-config_proc_fs=n.patch
scsi_libc-use-build_bug_on.patch
git-wireless.patch
paride-rename-pi_register-and-pi_unregister.patch
paride_register-shuffle-return-values.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux