linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Lameter <clameter@sgi.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	akpm@linux-foundation.org, torvalds@linux-foundation.org
Subject: Re: [RFC PATCH] type safe allocator
Date: Thu, 2 Aug 2007 12:16:23 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0708021211100.7948@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <E1IGVGf-0000sv-00@dorka.pomaz.szeredi.hu>

On Thu, 2 Aug 2007, Miklos Szeredi wrote:

> > If you define a new flag like GFP_ZERO_ATOMIC and GFP_ZERO_KERNEL you 
> > could do
> > 
> > 	kalloc(struct, GFP_ZERO_KERNEL)
> > 
> > instead of adding new variants?
> 
> I don't really like this, introducing new gfp flags just makes
> grepping harder.

The __GFP_ZERO flag has been around for a long time. GFP_ZERO_ATOMIC and 
GFP_ZERO_KERNEL or so could just be a shorthand notation.

Maybe

#define GFP_ZATOMIC (GFP_ATOMIC | __GFP_ZERO)
#define GFP_ZKERNEL (GFP_KERNEL | __GFP_ZERO)

?

> I do think that at least having a zeroing and a non-zeroing variant
> makes sense.

They require a duplication of the API and have led to inconsistencies 
because the complete API was not available with zeroing capabilities 
(there is still no kzalloc_node f.e.). 
Using a gfp flag allows all allocation functions to optionally zero data 
without having to define multiple functions.

The definition of new variants is a bit complicated since the allocator 
functions contain lots of smarts to do inline constant folding. This is 
necessary to determine the correct slab at compile time. I'd rather have 
as few of those as possible.

--
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-08-02 19:16 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-01  9:06 Miklos Szeredi
2007-08-01  9:29 ` Adrian Bunk
2007-08-01  9:41   ` Miklos Szeredi
2007-08-01 10:44 ` Andi Kleen
2007-08-01  9:57   ` Miklos Szeredi
2007-08-01 11:34     ` Andi Kleen
2007-08-01 10:45       ` Miklos Szeredi
2007-08-01 11:44         ` Jan Engelhardt
2007-08-01 11:56           ` Miklos Szeredi
2007-08-02  3:56 ` Linus Torvalds
2007-08-02  7:27   ` Miklos Szeredi
2007-08-02 12:05     ` Al Viro
2007-08-02 13:05       ` Miklos Szeredi
2007-08-02 17:23     ` Linus Torvalds
2007-08-02  5:33 ` Christoph Lameter
2007-08-02  7:38   ` Miklos Szeredi
2007-08-02 19:16     ` Christoph Lameter [this message]
2007-08-02  7:37 ` Satyam Sharma
2007-08-02  7:40   ` Miklos Szeredi
2007-08-02 11:31 ` [PATCH] " Miklos Szeredi, Miklos Szeredi
2007-08-02 12:04   ` Alexey Dobriyan
2007-08-02 12:24     ` Jan Engelhardt
2007-08-02 13:06       ` Miklos Szeredi
2007-08-02 13:35         ` Jan Engelhardt
2007-08-02 13:49           ` Miklos Szeredi
2007-08-02 13:47     ` Peter Zijlstra
2007-08-02 14:06       ` Bernd Petrovitsch
2007-08-02 14:08         ` Jan Engelhardt
2007-08-02 18:36   ` Andrew Morton
2007-08-02 18:48     ` Miklos Szeredi

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.0708021211100.7948@schroedinger.engr.sgi.com \
    --to=clameter@sgi.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=miklos@szeredi.hu \
    --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