diff options
author | Johannes Weiner <hannes@cmpxchg.org> | 2013-09-12 18:13:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-12 18:38:01 -0400 |
commit | 94bce453c78996cc4373d5da6cfabe07fcc6d9f9 (patch) | |
tree | e434ec0b39f716f08c12d24cd68cf6d0b293377e /arch/score | |
parent | f894ffa865301d4010d68b15be29912fa4039e77 (diff) |
arch: mm: remove obsolete init OOM protection
The memcg code can trap tasks in the context of the failing allocation
until an OOM situation is resolved. They can hold all kinds of locks
(fs, mm) at this point, which makes it prone to deadlocking.
This series converts memcg OOM handling into a two step process that is
started in the charge context, but any waiting is done after the fault
stack is fully unwound.
Patches 1-4 prepare architecture handlers to support the new memcg
requirements, but in doing so they also remove old cruft and unify
out-of-memory behavior across architectures.
Patch 5 disables the memcg OOM handling for syscalls, readahead, kernel
faults, because they can gracefully unwind the stack with -ENOMEM. OOM
handling is restricted to user triggered faults that have no other
option.
Patch 6 reworks memcg's hierarchical OOM locking to make it a little
more obvious wth is going on in there: reduce locked regions, rename
locking functions, reorder and document.
Patch 7 implements the two-part OOM handling such that tasks are never
trapped with the full charge stack in an OOM situation.
This patch:
Back before smart OOM killing, when faulting tasks were killed directly on
allocation failures, the arch-specific fault handlers needed special
protection for the init process.
Now that all fault handlers call into the generic OOM killer (see commit
609838cfed97: "mm: invoke oom-killer from remaining unconverted page
fault handlers"), which already provides init protection, the
arch-specific leftovers can be removed.
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: David Rientjes <rientjes@google.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: azurIt <azurit@pobox.sk>
Acked-by: Vineet Gupta <vgupta@synopsys.com> [arch/arc bits]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/score')
-rw-r--r-- | arch/score/mm/fault.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/arch/score/mm/fault.c b/arch/score/mm/fault.c index 6b18fb0189ae..4b71a626d41e 100644 --- a/arch/score/mm/fault.c +++ b/arch/score/mm/fault.c | |||
@@ -100,7 +100,6 @@ good_area: | |||
100 | goto bad_area; | 100 | goto bad_area; |
101 | } | 101 | } |
102 | 102 | ||
103 | survive: | ||
104 | /* | 103 | /* |
105 | * If for any reason at all we couldn't handle the fault, | 104 | * If for any reason at all we couldn't handle the fault, |
106 | * make sure we exit gracefully rather than endlessly redo | 105 | * make sure we exit gracefully rather than endlessly redo |
@@ -167,11 +166,6 @@ no_context: | |||
167 | */ | 166 | */ |
168 | out_of_memory: | 167 | out_of_memory: |
169 | up_read(&mm->mmap_sem); | 168 | up_read(&mm->mmap_sem); |
170 | if (is_global_init(tsk)) { | ||
171 | yield(); | ||
172 | down_read(&mm->mmap_sem); | ||
173 | goto survive; | ||
174 | } | ||
175 | if (!user_mode(regs)) | 169 | if (!user_mode(regs)) |
176 | goto no_context; | 170 | goto no_context; |
177 | pagefault_out_of_memory(); | 171 | pagefault_out_of_memory(); |