aboutsummaryrefslogtreecommitdiff
path: root/mm/percpu.c
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2010-10-30 15:56:54 +0200
committerTejun Heo <tj@kernel.org>2010-12-07 14:47:23 +0100
commit7af4c0932437f97938eef67e553c8d211f9edf33 (patch)
treeaa559f570cc86e238f86c1f9260514114d048545 /mm/percpu.c
parentcf7d7e5a1980d1116ee152d25dac382b112b9c17 (diff)
percpu: zero memory more efficiently in mm/percpu.c::pcpu_mem_alloc()
Don't do vmalloc() + memset() when vzalloc() will do. tj: dropped unnecessary temp variable ptr. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'mm/percpu.c')
-rw-r--r--mm/percpu.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/mm/percpu.c b/mm/percpu.c
index efe816856a9..9e16d1c9ebd 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -293,12 +293,8 @@ static void *pcpu_mem_alloc(size_t size)
if (size <= PAGE_SIZE)
return kzalloc(size, GFP_KERNEL);
- else {
- void *ptr = vmalloc(size);
- if (ptr)
- memset(ptr, 0, size);
- return ptr;
- }
+ else
+ return vzalloc(size);
}
/**