aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2006-10-20 02:28:32 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-20 13:26:38 -0400
commit8ac773b4f73afa6fd66695131103944b975d5d5c (patch)
tree7a3ea0d703cde009c5f2e1196d80f06cf5d00d54 /include
parent887b95931b4072e60e3bf4253ff7bffe372bca46 (diff)
[PATCH] OOM killer meets userspace headers
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@gmail.com> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Christoph Hellwig <hch@infradead.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/Kbuild1
-rw-r--r--include/linux/mm.h3
-rw-r--r--include/linux/oom.h10
3 files changed, 11 insertions, 3 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 5114ff18101d..a1155a2beb32 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -120,6 +120,7 @@ header-y += netrom.h
120header-y += nfs2.h 120header-y += nfs2.h
121header-y += nfs4_mount.h 121header-y += nfs4_mount.h
122header-y += nfs_mount.h 122header-y += nfs_mount.h
123header-y += oom.h
123header-y += param.h 124header-y += param.h
124header-y += pci_ids.h 125header-y += pci_ids.h
125header-y += pci_regs.h 126header-y += pci_regs.h
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 5a6068ff5556..d538de901965 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1115,9 +1115,6 @@ int in_gate_area_no_task(unsigned long addr);
1115#define in_gate_area(task, addr) ({(void)task; in_gate_area_no_task(addr);}) 1115#define in_gate_area(task, addr) ({(void)task; in_gate_area_no_task(addr);})
1116#endif /* __HAVE_ARCH_GATE_AREA */ 1116#endif /* __HAVE_ARCH_GATE_AREA */
1117 1117
1118/* /proc/<pid>/oom_adj set to -17 protects from the oom-killer */
1119#define OOM_DISABLE -17
1120
1121int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *, 1118int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *,
1122 void __user *, size_t *, loff_t *); 1119 void __user *, size_t *, loff_t *);
1123unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask, 1120unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask,
diff --git a/include/linux/oom.h b/include/linux/oom.h
new file mode 100644
index 000000000000..ad76463629a0
--- /dev/null
+++ b/include/linux/oom.h
@@ -0,0 +1,10 @@
1#ifndef __INCLUDE_LINUX_OOM_H
2#define __INCLUDE_LINUX_OOM_H
3
4/* /proc/<pid>/oom_adj set to -17 protects from the oom-killer */
5#define OOM_DISABLE (-17)
6/* inclusive */
7#define OOM_ADJUST_MIN (-16)
8#define OOM_ADJUST_MAX 15
9
10#endif