From: Jens Axboe <axboe@suse.de>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@osdl.org>,
rohit.seth@intel.com, Linus Torvalds <torvalds@osdl.org>
Subject: Re: 2.6.15-rc1-git crashes in kswapd
Date: Thu, 17 Nov 2005 21:35:02 +0100 [thread overview]
Message-ID: <20051117203502.GS7787@suse.de> (raw)
In-Reply-To: <20051117160624.GR7787@suse.de>
On Thu, Nov 17 2005, Jens Axboe wrote:
> This fixes it for me, does zonelist->zones change further down the path
> and we need the revalidation before after restarting?
>
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 104e69c..77c663f 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -857,6 +857,7 @@ restart:
> if (page)
> goto got_pg;
>
> + z = zonelist->zones; /* the list of zones suitable for gfp_mask */
> do
> wakeup_kswapd(*z, order);
> while (*(++z));
Ok, took a second look at this, the current code is definitely broken.
If we hit the oom killer, we goto restart with *z == NULL this time
since we already iterated through this loop once. Bad and 100%
reproducible for me, within 1 minute.
---
We must reassign z before looping through the zones kicking kswapd,
since it will be NULL if we hit an OOM condition and jump back to the
beginning again. 'z' is initially assigned before the restart: label. So
move the restart label up a little.
Signed-off-by: Jens Axboe <axboe@suse.de>
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 104e69c..bd4de59 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -845,21 +845,22 @@ __alloc_pages(gfp_t gfp_mask, unsigned i
might_sleep_if(wait);
+restart:
z = zonelist->zones; /* the list of zones suitable for gfp_mask */
if (unlikely(*z == NULL)) {
/* Should this ever happen?? */
return NULL;
}
-restart:
+
page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, order,
zonelist, ALLOC_CPUSET);
if (page)
goto got_pg;
- do
+ do {
wakeup_kswapd(*z, order);
- while (*(++z));
+ } while (*(++z));
/*
* OK, we're below the kswapd watermark and have kicked background
--
Jens Axboe
next prev parent reply other threads:[~2005-11-17 20:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-17 15:47 2.6.15-rc1-git crashes in kswapd Jens Axboe
2005-11-17 16:06 ` Jens Axboe
2005-11-17 20:35 ` Jens Axboe [this message]
2005-11-17 21:02 ` Andrew Morton
2005-11-17 23:00 ` Rohit Seth
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=20051117203502.GS7787@suse.de \
--to=axboe@suse.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rohit.seth@intel.com \
--cc=torvalds@osdl.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