From: Christoph Lameter <clameter@sgi.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mel Gorman <mel@skynet.ie>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Daniel Phillips <phillips@google.com>,
linux-mm <linux-mm@kvack.org>
Subject: Re: [PATCH] add __GFP_ZERO to GFP_LEVEL_MASK
Date: Tue, 24 Jul 2007 00:35:26 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0707240030110.3295@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <1185261894.8197.33.camel@twins>
On Tue, 24 Jul 2007, Peter Zijlstra wrote:
> > There is another exception for __GFP_DMA.
>
> non of the zone specifiers are
__GFP_DMA is handled in a similar way to __GFP_ZERO though. Its explicitly
listed in BUG_ON() because it can be specified in the gfpflags to kmalloc
but also set by having created a slab with SLAB_DMA. It is also cleared
by the & GFP_LEVEL_MASK.
> > > Anybody else got a preference?
> >
> > > #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
> > >
> > > -/* if you forget to add the bitmask here kernel will crash, period */
> > > +/*
> > > + * If you forget to add the bitmask here kernel will crash, period!
> > > + *
> > > + * GFP_LEVEL_MASK is used to filter out the flags that are to be passed to the
> > > + * page allocator.
> > > + *
> >
> > GFP_LEVEL_MASK is also used in mm/vmalloc.c. We need a definition that
> > goes beyond slab allocators.
>
> Right, bugger.
Lets get rid of the cryptic sentence there and explain it in a better way.
GFP_LEVEL_MASK contains the flags that are passed to the page allocator
by derived allocators (such as slab allocators and vmalloc, maybe the
uncached allocator may use it in the future?).
__get_vm_area_node also relies on GFP_LEVEL_MASK to clear the __GFP_ZERO
flag. Otherwise the kmalloc_node there would needlessly return zeroed
memory (or have failed in the past).
--
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:[~2007-07-24 7:35 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-23 10:03 [PATCH] add __GFP_ZERP " Peter Zijlstra
2007-07-23 11:21 ` Mel Gorman
2007-07-23 11:38 ` [PATCH] add __GFP_ZERO " Peter Zijlstra
2007-07-23 12:30 ` Mel Gorman
2007-07-23 23:17 ` Christoph Lameter
2007-07-24 6:01 ` Peter Zijlstra
2007-07-24 6:48 ` Peter Zijlstra
2007-07-24 7:14 ` Christoph Lameter
2007-07-24 7:09 ` Christoph Lameter
2007-07-24 7:24 ` Peter Zijlstra
2007-07-24 7:35 ` Christoph Lameter [this message]
2007-07-24 19:07 ` Christoph Lameter
2007-07-24 19:25 ` Andrew Morton
2007-07-24 19:36 ` Christoph Lameter
2007-07-24 22:10 ` Andrew Morton
2007-07-24 23:00 ` Christoph Lameter
2007-07-24 23:12 ` Andrew Morton
2007-07-24 23:58 ` Christoph Lameter
2007-07-25 0:06 ` Andrew Morton
2007-07-25 13:06 ` Mel Gorman
2007-07-23 18:37 ` [PATCH] add __GFP_ZERP " Andrew Morton
2007-07-23 18:40 ` Peter Zijlstra
2007-07-23 21:43 ` Christoph Lameter
2007-07-23 22:13 ` Andrew Morton
2007-07-23 22:41 ` Linus Torvalds
2007-07-23 22:56 ` Andrew Morton
2007-07-23 23:00 ` Christoph Lameter
2007-07-23 22:50 ` Christoph Lameter
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=Pine.LNX.4.64.0707240030110.3295@schroedinger.engr.sgi.com \
--to=clameter@sgi.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@skynet.ie \
--cc=phillips@google.com \
--cc=torvalds@linux-foundation.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