Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7af4c093 authored by Jesper Juhl's avatar Jesper Juhl Committed by Tejun Heo
Browse files

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: default avatarJesper Juhl <jj@chaosbits.net>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent cf7d7e5a
Loading
Loading
Loading
Loading
+2 −6
Original line number Original line Diff line number Diff line
@@ -293,12 +293,8 @@ static void *pcpu_mem_alloc(size_t size)


	if (size <= PAGE_SIZE)
	if (size <= PAGE_SIZE)
		return kzalloc(size, GFP_KERNEL);
		return kzalloc(size, GFP_KERNEL);
	else {
	else
		void *ptr = vmalloc(size);
		return vzalloc(size);
		if (ptr)
			memset(ptr, 0, size);
		return ptr;
	}
}
}


/**
/**