Re: [PATCH] mm: percpu: micro-optimize round-to-even

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 19 Jun 2014, Tejun Heo wrote:

> Indeed, a patch?

Subject: percpu: Use ALIGN macro instead of hand coding alignment calculation

Signed-off-by: Christoph Lameter <cl@xxxxxxxxx>

Index: linux/mm/percpu.c
===================================================================
--- linux.orig/mm/percpu.c	2014-06-04 13:43:12.541466633 -0500
+++ linux/mm/percpu.c	2014-06-19 09:56:10.458023912 -0500
@@ -720,8 +720,7 @@ static void __percpu *pcpu_alloc(size_t
 	if (unlikely(align < 2))
 		align = 2;

-	if (unlikely(size & 1))
-		size++;
+	size = ALIGN(size, 2);

 	if (unlikely(!size || size > PCPU_MIN_UNIT_SIZE || align > PAGE_SIZE)) {
 		WARN(true, "illegal size (%zu) or align (%zu) for "

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]