提交 7af4c093 编写于 作者: J Jesper Juhl 提交者: Tejun Heo

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: NJesper Juhl <jj@chaosbits.net>
Signed-off-by: NTejun Heo <tj@kernel.org>
上级 cf7d7e5a
......@@ -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);
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册