diff options
author | Hugh Dickins <hugh.dickins@tiscali.co.uk> | 2009-09-21 20:02:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-22 10:17:33 -0400 |
commit | 35451beecbd7c86ce3249d543594517a5fe9a0cd (patch) | |
tree | e72759e6e6fcd142ab85c607a9b3dd3e1c016eed /include/linux/sched.h | |
parent | a913e182ab9484308e870af37a14d372742d53b0 (diff) |
ksm: unmerge is an origin of OOMs
Just as the swapoff system call allocates many pages of RAM to various
processes, perhaps triggering OOM, so "echo 2 >/sys/kernel/mm/ksm/run"
(unmerge) is liable to allocate many pages of RAM to various processes,
perhaps triggering OOM; and each is normally run from a modest admin
process (swapoff or shell), easily repeated until it succeeds.
So treat unmerge_and_remove_all_rmap_items() in the same way that we treat
try_to_unuse(): generalize PF_SWAPOFF to PF_OOM_ORIGIN, and bracket both
with that, to ask the OOM killer to kill them first, to prevent them from
spawning more and more OOM kills.
Signed-off-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Acked-by: Izik Eidus <ieidus@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/sched.h')
-rw-r--r-- | include/linux/sched.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 8f3e63cb33a6..899d7304d594 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1720,7 +1720,7 @@ extern cputime_t task_gtime(struct task_struct *p); | |||
1720 | #define PF_FROZEN 0x00010000 /* frozen for system suspend */ | 1720 | #define PF_FROZEN 0x00010000 /* frozen for system suspend */ |
1721 | #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ | 1721 | #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ |
1722 | #define PF_KSWAPD 0x00040000 /* I am kswapd */ | 1722 | #define PF_KSWAPD 0x00040000 /* I am kswapd */ |
1723 | #define PF_SWAPOFF 0x00080000 /* I am in swapoff */ | 1723 | #define PF_OOM_ORIGIN 0x00080000 /* Allocating much memory to others */ |
1724 | #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ | 1724 | #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ |
1725 | #define PF_KTHREAD 0x00200000 /* I am a kernel thread */ | 1725 | #define PF_KTHREAD 0x00200000 /* I am a kernel thread */ |
1726 | #define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ | 1726 | #define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */ |