Re: [RFC PATCH] type safe allocator

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Miklos Szeredi <miklos@...>
Cc: <linux-kernel@...>, <linux-mm@...>, <akpm@...>, <torvalds@...>
Date: Thursday, August 2, 2007 - 3:16 pm

On Thu, 2 Aug 2007, Miklos Szeredi wrote:


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)

?


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.
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC PATCH] type safe allocator, Miklos Szeredi, (Wed Aug 1, 5:06 am)
Re: [RFC PATCH] type safe allocator, Satyam Sharma, (Thu Aug 2, 3:37 am)
Re: [RFC PATCH] type safe allocator, Miklos Szeredi, (Thu Aug 2, 3:40 am)
Re: [RFC PATCH] type safe allocator, Christoph Lameter, (Thu Aug 2, 1:33 am)
Re: [RFC PATCH] type safe allocator, Miklos Szeredi, (Thu Aug 2, 3:38 am)
Re: [RFC PATCH] type safe allocator, Christoph Lameter, (Thu Aug 2, 3:16 pm)
Re: [RFC PATCH] type safe allocator, Linus Torvalds, (Wed Aug 1, 11:56 pm)
Re: [RFC PATCH] type safe allocator, Miklos Szeredi, (Thu Aug 2, 3:27 am)
Re: [RFC PATCH] type safe allocator, Linus Torvalds, (Thu Aug 2, 1:23 pm)
Re: [RFC PATCH] type safe allocator, Al Viro, (Thu Aug 2, 8:05 am)
Re: [RFC PATCH] type safe allocator, Miklos Szeredi, (Thu Aug 2, 9:05 am)
Re: [RFC PATCH] type safe allocator, Andi Kleen, (Wed Aug 1, 6:44 am)
Re: [RFC PATCH] type safe allocator, Miklos Szeredi, (Wed Aug 1, 5:57 am)
Re: [RFC PATCH] type safe allocator, Andi Kleen, (Wed Aug 1, 7:34 am)
Re: [RFC PATCH] type safe allocator, Adrian Bunk, (Wed Aug 1, 5:29 am)
Re: [RFC PATCH] type safe allocator, Miklos Szeredi, (Wed Aug 1, 5:41 am)