From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Christoph Lameter <clameter@sgi.com>
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 08:01:09 +0200 [thread overview]
Message-ID: <1185256869.8197.27.camel@twins> (raw)
In-Reply-To: <Pine.LNX.4.64.0707231615310.427@schroedinger.engr.sgi.com>
On Mon, 2007-07-23 at 16:17 -0700, Christoph Lameter wrote:
> On Mon, 23 Jul 2007, Peter Zijlstra wrote:
>
> > ---
> > Daniel recently spotted that __GFP_ZERO is not (and has never been)
> > part of GFP_LEVEL_MASK. I could not find a reason for this in the
> > original patch: 3977971c7f09ce08ed1b8d7a67b2098eb732e4cd in the -bk
> > tree.
> >
> > This of course is in stark contradiction with the comment accompanying
> > GFP_LEVEL_MASK.
>
> NACK.
>
> The effect that this patch will have is that __GFP_ZERO is passed through
> to the page allocator which will needlessly zero pages. GFP_LEVEL_MASK is
> used to filter out the flags that are to be passed to the page allocator.
> __GFP_ZERO is not passed on but handled by the slab allocators.
Then we can either fixup the slab allocators to mask out __GFP_ZERO, or
do something like the below.
Personally I like the consistency of adding __GFP_ZERO here (removes
this odd exception) and just masking it in the sl[aou]b thingies.
Anybody else got a preference?
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
include/linux/gfp.h | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
Index: linux-2.6-2/include/linux/gfp.h
===================================================================
--- linux-2.6-2.orig/include/linux/gfp.h
+++ linux-2.6-2/include/linux/gfp.h
@@ -53,7 +53,14 @@ struct vm_area_struct;
#define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */
#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_ZERO is not passed on but handled by the slab allocators.
+ */
#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \
__GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \
__GFP_NOFAIL|__GFP_NORETRY|__GFP_COMP| \
WARNING: multiple messages have this Message-ID (diff)
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Christoph Lameter <clameter@sgi.com>
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 08:01:09 +0200 [thread overview]
Message-ID: <1185256869.8197.27.camel@twins> (raw)
In-Reply-To: <Pine.LNX.4.64.0707231615310.427@schroedinger.engr.sgi.com>
On Mon, 2007-07-23 at 16:17 -0700, Christoph Lameter wrote:
> On Mon, 23 Jul 2007, Peter Zijlstra wrote:
>
> > ---
> > Daniel recently spotted that __GFP_ZERO is not (and has never been)
> > part of GFP_LEVEL_MASK. I could not find a reason for this in the
> > original patch: 3977971c7f09ce08ed1b8d7a67b2098eb732e4cd in the -bk
> > tree.
> >
> > This of course is in stark contradiction with the comment accompanying
> > GFP_LEVEL_MASK.
>
> NACK.
>
> The effect that this patch will have is that __GFP_ZERO is passed through
> to the page allocator which will needlessly zero pages. GFP_LEVEL_MASK is
> used to filter out the flags that are to be passed to the page allocator.
> __GFP_ZERO is not passed on but handled by the slab allocators.
Then we can either fixup the slab allocators to mask out __GFP_ZERO, or
do something like the below.
Personally I like the consistency of adding __GFP_ZERO here (removes
this odd exception) and just masking it in the sl[aou]b thingies.
Anybody else got a preference?
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
include/linux/gfp.h | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
Index: linux-2.6-2/include/linux/gfp.h
===================================================================
--- linux-2.6-2.orig/include/linux/gfp.h
+++ linux-2.6-2/include/linux/gfp.h
@@ -53,7 +53,14 @@ struct vm_area_struct;
#define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */
#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_ZERO is not passed on but handled by the slab allocators.
+ */
#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \
__GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \
__GFP_NOFAIL|__GFP_NORETRY|__GFP_COMP| \
--
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 6:01 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-23 10:03 [PATCH] add __GFP_ZERP to GFP_LEVEL_MASK Peter Zijlstra
2007-07-23 10:03 ` Peter Zijlstra
2007-07-23 11:21 ` Mel Gorman
2007-07-23 11:21 ` Mel Gorman
2007-07-23 11:38 ` [PATCH] add __GFP_ZERO " Peter Zijlstra
2007-07-23 11:38 ` Peter Zijlstra
2007-07-23 12:30 ` Mel Gorman
2007-07-23 12:30 ` Mel Gorman
2007-07-23 23:17 ` Christoph Lameter
2007-07-23 23:17 ` Christoph Lameter
2007-07-24 6:01 ` Peter Zijlstra [this message]
2007-07-24 6:01 ` Peter Zijlstra
2007-07-24 6:48 ` Peter Zijlstra
2007-07-24 6:48 ` Peter Zijlstra
2007-07-24 7:14 ` Christoph Lameter
2007-07-24 7:14 ` Christoph Lameter
2007-07-24 7:09 ` Christoph Lameter
2007-07-24 7:09 ` Christoph Lameter
2007-07-24 7:24 ` Peter Zijlstra
2007-07-24 7:24 ` Peter Zijlstra
2007-07-24 7:35 ` Christoph Lameter
2007-07-24 7:35 ` Christoph Lameter
2007-07-24 19:07 ` Christoph Lameter
2007-07-24 19:07 ` Christoph Lameter
2007-07-24 19:25 ` Andrew Morton
2007-07-24 19:25 ` Andrew Morton
2007-07-24 19:36 ` Christoph Lameter
2007-07-24 19:36 ` Christoph Lameter
2007-07-24 22:10 ` Andrew Morton
2007-07-24 22:10 ` Andrew Morton
2007-07-24 23:00 ` Christoph Lameter
2007-07-24 23:00 ` Christoph Lameter
2007-07-24 23:12 ` Andrew Morton
2007-07-24 23:12 ` Andrew Morton
2007-07-24 23:58 ` Christoph Lameter
2007-07-24 23:58 ` Christoph Lameter
2007-07-25 0:06 ` Andrew Morton
2007-07-25 0:06 ` Andrew Morton
2007-07-25 13:06 ` Mel Gorman
2007-07-25 13:06 ` Mel Gorman
2007-07-23 18:37 ` [PATCH] add __GFP_ZERP " Andrew Morton
2007-07-23 18:37 ` Andrew Morton
2007-07-23 18:40 ` Peter Zijlstra
2007-07-23 18:40 ` Peter Zijlstra
2007-07-23 21:43 ` Christoph Lameter
2007-07-23 21:43 ` Christoph Lameter
2007-07-23 22:13 ` Andrew Morton
2007-07-23 22:13 ` Andrew Morton
2007-07-23 22:41 ` Linus Torvalds
2007-07-23 22:41 ` Linus Torvalds
2007-07-23 22:56 ` Andrew Morton
2007-07-23 22:56 ` Andrew Morton
2007-07-23 23:00 ` Christoph Lameter
2007-07-23 23:00 ` Christoph Lameter
2007-07-23 22:50 ` 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=1185256869.8197.27.camel@twins \
--to=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=clameter@sgi.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.