From: Paul Jackson <pj@sgi.com>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: linux-mm@kvack.org, akpm@osdl.org, rientjes@google.com,
ak@suse.de, mbligh@google.com, rohitseth@google.com,
menage@google.com, clameter@sgi.com
Subject: Re: [RFC] memory page alloc minor cleanups
Date: Mon, 9 Oct 2006 13:24:04 -0700 [thread overview]
Message-ID: <20061009132404.e6f8522d.pj@sgi.com> (raw)
In-Reply-To: <452A4A9D.40605@yahoo.com.au>
Probably in response to my patch lines:
@@ -1056,21 +1057,13 @@ __alloc_pages(gfp_t gfp_mask, unsigned i
...
- if (unlikely(*z == NULL)) {
- /* Should this ever happen?? */
- return NULL;
- }
Nick wrote:
> Would it be better to ensure an empty zonelist is never passed down?
Are you saying we should leave this empty zonelist check where it was,
or we should somehow ensure that we never get to __alloc_pages with an
empty zonelist in the first place? Not clear ...
What seems clear to me is that this check is in the wrong place, and if
needed, is the wrong check.
The check is not needed right there. If we have an empty zonelist, then
that just makes the zonelist scanning go all the faster ;). Harmless,
silly, but rare.
Not until much deeper in the allocation code, when we have to make some
hard choices, like oom or panic or loop forever (hopelessly) looking
for pages off an empty zonelist, do we actually have to worry about
empty zonelists.
So either:
* the check is not needed, if empty zonelists can't happen, or
* the check should be moved out of the hot spot it is in now,
where it has no need of being, to where it is needed, lower down,
in less frequently executed code.
And if it is needed, the logic of the check seems slightly
oversimplified:
I'd think it should consider (1) allocations requests that can
fail in which case we return NULL, separately from (2) allocation
requests that cannot fail in which case we are on an impossible
mission, as the caller is insisting that we do not fail to find
a page on an empty list.
Perhaps in this second case, we pick the local nodes default full
sized zonelist and find a page for our demanding caller that way.
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.925.600.0401
--
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>
next prev parent reply other threads:[~2006-10-09 20:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-09 10:54 Paul Jackson, Paul Jackson
2006-10-09 10:54 ` [RFC] memory page_alloc zonelist caching speedup Paul Jackson
2006-10-09 18:12 ` Andrew Morton
2006-10-09 22:02 ` Paul Jackson
2006-10-10 4:51 ` Paul Jackson
2006-10-10 6:34 ` David Rientjes
2006-10-10 7:03 ` Paul Jackson
2006-10-10 17:07 ` Christoph Lameter
2006-10-10 19:35 ` Paul Jackson
2006-10-10 6:45 ` Paul Jackson
2006-10-09 11:08 ` [RFC] memory page alloc minor cleanups Christoph Lameter
2006-10-09 11:50 ` Paul Jackson
2006-10-09 17:12 ` Christoph Lameter
2006-10-09 13:11 ` Nick Piggin
2006-10-09 20:24 ` Paul Jackson [this message]
2006-10-10 1:45 ` Paul Jackson
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=20061009132404.e6f8522d.pj@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