From: Jesper Juhl Date: Sat, 30 Oct 2010 13:56:54 +0000 (+0200) Subject: percpu: zero memory more efficiently in mm/percpu.c::pcpu_mem_alloc() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=7af4c0932437f97938eef67e553c8d211f9edf33;p=linux-beck.git 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 Signed-off-by: Tejun Heo --- diff --git a/mm/percpu.c b/mm/percpu.c index efe816856a9d..9e16d1c9ebd5 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); } /**