Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 39970
b: refs/heads/master
c: 8ac773b
h: refs/heads/master
v: v3
  • Loading branch information
Alexey Dobriyan authored and Linus Torvalds committed Oct 20, 2006
1 parent 3ab3b44 commit 0435c85
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 887b95931b4072e60e3bf4253ff7bffe372bca46
refs/heads/master: 8ac773b4f73afa6fd66695131103944b975d5d5c
4 changes: 3 additions & 1 deletion trunk/fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
#include <linux/audit.h>
#include <linux/poll.h>
#include <linux/nsproxy.h>
#include <linux/oom.h>
#include "internal.h"

/* NOTE:
Expand Down Expand Up @@ -689,7 +690,8 @@ static ssize_t oom_adjust_write(struct file *file, const char __user *buf,
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++;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions trunk/include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1115,9 +1115,6 @@ int in_gate_area_no_task(unsigned long addr);
#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,
Expand Down
10 changes: 10 additions & 0 deletions trunk/include/linux/oom.h
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions trunk/mm/oom_kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 0435c85

Please sign in to comment.