From: Paul Jackson <pj@sgi.com>
From: Paul Jackson <pj@sgi.com>
To: linux-mm@kvack.org
Cc: Andrew Morton <akpm@osdl.org>,
Nick Piggin <nickpiggin@yahoo.com.au>,
David Rientjes <rientjes@google.com>, Andi Kleen <ak@suse.de>,
mbligh@google.com, rohitseth@google.com, menage@google.com,
Paul Jackson <pj@sgi.com>, Christoph Lameter <clameter@sgi.com>
Subject: [PATCH] memory page_alloc revert empty zonelist check
Date: Tue, 10 Oct 2006 01:13:57 -0700 [thread overview]
Message-ID: <20061010081357.15156.55404.sendpatchset@jackhammer.engr.sgi.com> (raw)
Backout one item from a previous "memory page_alloc minor
cleanups" patch. Until and unless we are certain that no one
can ever pass an empty zonelist to __alloc_pages(), this check
for an empty zonelist (or some BUG equivalent) is essential.
The code in get_page_from_freelist() blow ups if passed an
empty zonelist.
Signed-off-by: Paul Jackson
---
Andrew - applies on top of my "memory page_alloc minor cleanups"
patch. -pj
mm/page_alloc.c | 7 +++++++
1 file changed, 7 insertions(+)
--- 2.6.18-mm3.orig/mm/page_alloc.c 2006-10-10 00:25:31.751908557 -0700
+++ 2.6.18-mm3/mm/page_alloc.c 2006-10-10 00:25:32.567919262 -0700
@@ -1057,6 +1057,13 @@ __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;
+ }
+
page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, order,
zonelist, ALLOC_WMARK_LOW|ALLOC_CPUSET);
if (page)
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.650.933.1373
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
reply other threads:[~2006-10-10 8:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20061010081357.15156.55404.sendpatchset@jackhammer.engr.sgi.com \
--to=pj@sgi.com \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=clameter@sgi.com \
--cc=linux-mm@kvack.org \
--cc=mbligh@google.com \
--cc=menage@google.com \
--cc=nickpiggin@yahoo.com.au \
--cc=rientjes@google.com \
--cc=rohitseth@google.com \
/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