All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Christoph Lameter <clameter@sgi.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Daniel Phillips <phillips@google.com>,
	linux-mm <linux-mm@kvack.org>
Subject: Re: [PATCH] add __GFP_ZERP to GFP_LEVEL_MASK
Date: Mon, 23 Jul 2007 15:56:03 -0700	[thread overview]
Message-ID: <20070723155603.f1b1a735.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.LFD.0.999.0707231539520.3607@woody.linux-foundation.org>

On Mon, 23 Jul 2007 15:41:36 -0700 (PDT)
Linus Torvalds <torvalds@linux-foundation.org> wrote:

> 
> 
> On Mon, 23 Jul 2007, Andrew Morton wrote:
> > 
> > OK, well that was weird.  So
> > 
> > 	kmalloc(42, GFP_KERNEL|__GFP_ZERO);
> > 
> > duplicates
> > 
> > 	kzalloc(42, GFP_KERNEL);
> > 
> > Why do it both ways?
> 
> Both ways? The latter *is* the former. That's how kzalloc() is implemented 
> these days.

<looks>

So this:

	/*
	 * Be lazy and only check for valid flags here,  keeping it out of the
	 * critical path in kmem_cache_alloc().
	 */
	BUG_ON(flags & ~(GFP_DMA | __GFP_ZERO | GFP_LEVEL_MASK));

would no longer need the __GFP_ZERO.  Ditto in slob's new_slab().


> Andrew - all these patches came through you. You didn't realize?

Well.  I didn't memorise the past few months' 250-odd slab/slob/slub
patches..

My point is, I don't think we want some code doing
kmalloc(42, GFP_KERNEL|__GFP_ZERO) and some other code doing
kzalloc(42, GFP_KERNEL).  But this patch does nothing to increase the
chances of that happening, so I'm happy.



WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Christoph Lameter <clameter@sgi.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Daniel Phillips <phillips@google.com>,
	linux-mm <linux-mm@kvack.org>
Subject: Re: [PATCH] add __GFP_ZERP to GFP_LEVEL_MASK
Date: Mon, 23 Jul 2007 15:56:03 -0700	[thread overview]
Message-ID: <20070723155603.f1b1a735.akpm@linux-foundation.org> (raw)
In-Reply-To: <alpine.LFD.0.999.0707231539520.3607@woody.linux-foundation.org>

On Mon, 23 Jul 2007 15:41:36 -0700 (PDT)
Linus Torvalds <torvalds@linux-foundation.org> wrote:

> 
> 
> On Mon, 23 Jul 2007, Andrew Morton wrote:
> > 
> > OK, well that was weird.  So
> > 
> > 	kmalloc(42, GFP_KERNEL|__GFP_ZERO);
> > 
> > duplicates
> > 
> > 	kzalloc(42, GFP_KERNEL);
> > 
> > Why do it both ways?
> 
> Both ways? The latter *is* the former. That's how kzalloc() is implemented 
> these days.

<looks>

So this:

	/*
	 * Be lazy and only check for valid flags here,  keeping it out of the
	 * critical path in kmem_cache_alloc().
	 */
	BUG_ON(flags & ~(GFP_DMA | __GFP_ZERO | GFP_LEVEL_MASK));

would no longer need the __GFP_ZERO.  Ditto in slob's new_slab().


> Andrew - all these patches came through you. You didn't realize?

Well.  I didn't memorise the past few months' 250-odd slab/slob/slub
patches..

My point is, I don't think we want some code doing
kmalloc(42, GFP_KERNEL|__GFP_ZERO) and some other code doing
kzalloc(42, GFP_KERNEL).  But this patch does nothing to increase the
chances of that happening, so I'm happy.


--
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:[~2007-07-23 22:56 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
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 [this message]
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=20070723155603.f1b1a735.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=clameter@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --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.