diff options
author | Christoph Lameter <clameter@sgi.com> | 2007-07-17 07:03:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-17 13:23:02 -0400 |
commit | 94f6030ca792c57422f04a73e7a872d8325946d3 (patch) | |
tree | 0197f24d82b1706f1b0521f2cf68feeff64123df /mm/vmalloc.c | |
parent | 81cda6626178cd55297831296ba8ecedbfd8b52d (diff) |
Slab allocators: Replace explicit zeroing with __GFP_ZERO
kmalloc_node() and kmem_cache_alloc_node() were not available in a zeroing
variant in the past. But with __GFP_ZERO it is possible now to do zeroing
while allocating.
Use __GFP_ZERO to remove the explicit clearing of memory via memset whereever
we can.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/vmalloc.c')
-rw-r--r-- | mm/vmalloc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index ddf87145cc49..8e05a11155c9 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c | |||
@@ -432,11 +432,12 @@ void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask, | |||
432 | area->nr_pages = nr_pages; | 432 | area->nr_pages = nr_pages; |
433 | /* Please note that the recursion is strictly bounded. */ | 433 | /* Please note that the recursion is strictly bounded. */ |
434 | if (array_size > PAGE_SIZE) { | 434 | if (array_size > PAGE_SIZE) { |
435 | pages = __vmalloc_node(array_size, gfp_mask, PAGE_KERNEL, node); | 435 | pages = __vmalloc_node(array_size, gfp_mask | __GFP_ZERO, |
436 | PAGE_KERNEL, node); | ||
436 | area->flags |= VM_VPAGES; | 437 | area->flags |= VM_VPAGES; |
437 | } else { | 438 | } else { |
438 | pages = kmalloc_node(array_size, | 439 | pages = kmalloc_node(array_size, |
439 | (gfp_mask & GFP_LEVEL_MASK), | 440 | (gfp_mask & GFP_LEVEL_MASK) | __GFP_ZERO, |
440 | node); | 441 | node); |
441 | } | 442 | } |
442 | area->pages = pages; | 443 | area->pages = pages; |
@@ -445,7 +446,6 @@ void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask, | |||
445 | kfree(area); | 446 | kfree(area); |
446 | return NULL; | 447 | return NULL; |
447 | } | 448 | } |
448 | memset(area->pages, 0, array_size); | ||
449 | 449 | ||
450 | for (i = 0; i < area->nr_pages; i++) { | 450 | for (i = 0; i < area->nr_pages; i++) { |
451 | if (node < 0) | 451 | if (node < 0) |