Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932862AbaFSO7W (ORCPT ); Thu, 19 Jun 2014 10:59:22 -0400 Received: from qmta10.emeryville.ca.mail.comcast.net ([76.96.30.17]:49078 "EHLO qmta10.emeryville.ca.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932443AbaFSO7V (ORCPT ); Thu, 19 Jun 2014 10:59:21 -0400 Date: Thu, 19 Jun 2014 09:59:18 -0500 (CDT) From: Christoph Lameter To: Tejun Heo cc: Rasmus Villemoes , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: percpu: micro-optimize round-to-even In-Reply-To: <20140619143458.GF26904@htj.dyndns.org> Message-ID: References: <1403172149-25353-1-git-send-email-linux@rasmusvillemoes.dk> <20140619132536.GF11042@htj.dyndns.org> <20140619143458.GF26904@htj.dyndns.org> Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/