Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760016AbYFDO60 (ORCPT ); Wed, 4 Jun 2008 10:58:26 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754172AbYFDO6R (ORCPT ); Wed, 4 Jun 2008 10:58:17 -0400 Received: from relay1.sgi.com ([192.48.171.29]:38996 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754079AbYFDO6O (ORCPT ); Wed, 4 Jun 2008 10:58:14 -0400 Message-ID: <4846AD84.2090800@sgi.com> Date: Wed, 04 Jun 2008 07:58:12 -0700 From: Mike Travis User-Agent: Thunderbird 2.0.0.6 (X11/20070801) MIME-Version: 1.0 To: Christoph Lameter CC: Eric Dumazet , akpm@linux-foundation.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, David Miller , Peter Zijlstra , Rusty Russell Subject: Re: [patch 02/41] cpu alloc: The allocator References: <20080530035620.587204923@sgi.com> <20080530040011.084909898@sgi.com> <483F8AF7.9000309@cosmosbay.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1427 Lines: 39 Christoph Lameter wrote: > On Fri, 30 May 2008, Eric Dumazet wrote: > >>> +static DEFINE_PER_CPU(UNIT_TYPE, area[UNITS]); >>> >> area[] is not guaranteed to be aligned on anything but 4 bytes. >> >> If someone then needs to call cpu_alloc(8, GFP_KERNEL, 8), it might get an non >> aligned result. >> >> Either you should add an __attribute__((__aligned__(PAGE_SIZE))), >> or take into account the real address of area[] in cpu_alloc() to avoid waste >> of up to PAGE_SIZE bytes >> per cpu. > > I think cacheline aligning should be sufficient. People should not > allocate large page aligned objects here. I'm a bit confused. Why is DEFINE_PER_CPU_SHARED_ALIGNED() conditioned on ifdef MODULE? #ifdef MODULE #define SHARED_ALIGNED_SECTION ".data.percpu" #else #define SHARED_ALIGNED_SECTION ".data.percpu.shared_aligned" #endif #define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \ __attribute__((__section__(SHARED_ALIGNED_SECTION))) \ PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name \ ____cacheline_aligned_in_smp Thanks, Mike -- 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/