lkml.org 
[lkml]   [2006]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH,RFC] Add __GFP_ZERO to GFP_LEVEL_MASK
On Fri, 13 Oct 2006 15:00:22 -0600
corbet@lwn.net (Jonathan Corbet) wrote:

> Andrew Morton <akpm@osdl.org> wrote:
>
> > It would be a bit odd to pass __GFP_ZERO into the slab allocator. Slab
> > doesn't need that hint: it has its own ways of initialising the memory.
> >
> > What is the callsite?
>
> It's vmalloc_user(), which does this:
>
> ret = __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, PAGE_KERNEL);
>

oic, yes, that was a recent change.

I guess this will do the trick?


diff -puN mm/vmalloc.c~vmalloc-dont-pass-__gfp_zero-to-slab mm/vmalloc.c
--- a/mm/vmalloc.c~vmalloc-dont-pass-__gfp_zero-to-slab
+++ a/mm/vmalloc.c
@@ -428,8 +428,11 @@ void *__vmalloc_area_node(struct vm_stru
if (array_size > PAGE_SIZE) {
pages = __vmalloc_node(array_size, gfp_mask, PAGE_KERNEL, node);
area->flags |= VM_VPAGES;
- } else
- pages = kmalloc_node(array_size, (gfp_mask & ~__GFP_HIGHMEM), node);
+ } else {
+ pages = kmalloc_node(array_size,
+ (gfp_mask & ~(__GFP_HIGHMEM | __GFP_ZERO)),
+ node);
+ }
area->pages = pages;
if (!area->pages) {
remove_vm_area(area->addr);
_


(hmm, __vmalloc_area_node and __vmalloc_node are mutually recursive. ick.)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-10-13 23:33    [W:0.049 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site