diff options
author | Kirill Korotaev <dev@openvz.org> | 2006-12-06 23:32:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:22 -0500 |
commit | b43a57bb4dae72e8f7232e7c821a8799eda30022 (patch) | |
tree | 4293286b44c8b11bac6a03c4ddfe75aea40aa089 /mm | |
parent | a3eea484f7a1aadb70ed6665338026a09ad6ce85 (diff) |
[PATCH] OOM can panic due to processes stuck in __alloc_pages()
OOM can panic due to the processes stuck in __alloc_pages() doing infinite
rebalance loop while no memory can be reclaimed. OOM killer tries to kill
some processes, but unfortunetaly, rebalance label was moved by someone
below the TIF_MEMDIE check, so buddy allocator doesn't see that process is
OOM-killed and it can simply fail the allocation :/
Observed in reality on RHEL4(2.6.9)+OpenVZ kernel when a user doing some
memory allocation tricks triggered OOM panic.
Signed-off-by: Denis Lunev <den@sw.ru>
Signed-off-by: Kirill Korotaev <dev@openvz.org>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/page_alloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index cd47e8f7bd5b..a840e702722c 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -1180,6 +1180,7 @@ restart: | |||
1180 | 1180 | ||
1181 | /* This allocation should allow future memory freeing. */ | 1181 | /* This allocation should allow future memory freeing. */ |
1182 | 1182 | ||
1183 | rebalance: | ||
1183 | if (((p->flags & PF_MEMALLOC) || unlikely(test_thread_flag(TIF_MEMDIE))) | 1184 | if (((p->flags & PF_MEMALLOC) || unlikely(test_thread_flag(TIF_MEMDIE))) |
1184 | && !in_interrupt()) { | 1185 | && !in_interrupt()) { |
1185 | if (!(gfp_mask & __GFP_NOMEMALLOC)) { | 1186 | if (!(gfp_mask & __GFP_NOMEMALLOC)) { |
@@ -1201,7 +1202,6 @@ nofail_alloc: | |||
1201 | if (!wait) | 1202 | if (!wait) |
1202 | goto nopage; | 1203 | goto nopage; |
1203 | 1204 | ||
1204 | rebalance: | ||
1205 | cond_resched(); | 1205 | cond_resched(); |
1206 | 1206 | ||
1207 | /* We now go into synchronous reclaim */ | 1207 | /* We now go into synchronous reclaim */ |