From: Kirill Korotaev <dev@openvz.org>
To: Andrew Morton <akpm@osdl.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
devel@openvz.org
Subject: [PATCH]: OOM can panic due to processes stuck in __alloc_pages()
Date: Mon, 13 Nov 2006 22:13:47 +0300 [thread overview]
Message-ID: <4558C3EB.1070400@openvz.org> (raw)
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>
--- ./mm/page_alloc.c.oomx 2006-11-08 17:44:16.000000000 +0300
+++ ./mm/page_alloc.c 2006-11-13 21:57:33.000000000 +0300
@@ -1251,6 +1251,7 @@ restart:
/* This allocation should allow future memory freeing. */
+rebalance:
if (((p->flags & PF_MEMALLOC) || unlikely(test_thread_flag(TIF_MEMDIE)))
&& !in_interrupt()) {
if (!(gfp_mask & __GFP_NOMEMALLOC)) {
@@ -1272,7 +1273,6 @@ nofail_alloc:
if (!wait)
goto nopage;
-rebalance:
cond_resched();
/* We now go into synchronous reclaim */
next reply other threads:[~2006-11-13 19:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-13 19:13 Kirill Korotaev [this message]
2006-11-13 22:56 ` [PATCH]: OOM can panic due to processes stuck in __alloc_pages() Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4558C3EB.1070400@openvz.org \
--to=dev@openvz.org \
--cc=akpm@osdl.org \
--cc=devel@openvz.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox