lkml.org 
[lkml]   [1999]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: PATCH 2.3.26: kmalloc GFP_ZERO
On Tue, Nov 09, 1999 at 10:38:12AM +0100, Jes Sorensen wrote:
> >>>>> "Jeff" == Jeff Garzik <jgarzik@mandrakesoft.com> writes:
>
> Jeff> Attached is a patch against 2.3.26 which adds the GFP_ZERO flag.
> Jeff> There is a lot of code which does
>
> Jeff> ptr = kmalloc(size, ...); memset (ptr, 0, size);
>
> By doing this you add another `if' clause to hot path code in the
> memory allocator, this is IMHO not a very good idea. Let the drivers
> which know they need zeroed memory, clear it out themselves.

How about a zkmalloc() call which calls kmalloc, then does the memset?
It might lead to a small reduction in code size, but it's probably
pointless.

--
Matthew Wilcox <willy@bofh.ai>
"Windows and MacOS are products, contrived by engineers in the service of
specific companies. Unix, by contrast, is not so much a product as it is a
painstakingly compiled oral history of the hacker subculture." - N Stephenson

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:54    [W:2.891 / U:25.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site