Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964904AbYBWIXl (ORCPT ); Sat, 23 Feb 2008 03:23:41 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1765844AbYBWIJj (ORCPT ); Sat, 23 Feb 2008 03:09:39 -0500 Received: from smtp1.linux-foundation.org ([207.189.120.13]:34151 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933254AbYBWIJT (ORCPT ); Sat, 23 Feb 2008 03:09:19 -0500 Date: Sat, 23 Feb 2008 00:04:48 -0800 From: Andrew Morton To: Eric Dumazet Cc: "David S. Miller" , linux kernel , netdev@vger.kernel.org, Christoph Lameter , "Zhang, Yanmin" Subject: Re: [PATCH] alloc_percpu() fails to allocate percpu data Message-Id: <20080223000448.9dadd2c5.akpm@linux-foundation.org> In-Reply-To: <47BDBC23.10605@cosmosbay.com> References: <47BDBC23.10605@cosmosbay.com> X-Mailer: Sylpheed 2.4.1 (GTK+ 2.8.17; x86_64-unknown-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 933 Lines: 29 On Thu, 21 Feb 2008 19:00:03 +0100 Eric Dumazet wrote: > +#ifndef cache_line_size > +#define cache_line_size() L1_CACHE_BYTES > +#endif argh, you made me look. Really cache_line_size() should be implemented in include/linux/cache.h. Then we tromp the stupid private implementations in slob.c and slub.c. Then we wonder why x86 uses a custom cache_line_size(), but still uses L1_CACHE_BYTES for its L1_CACHE_ALIGN(). Once we've answered that, we look at your + /* + * We should make sure each CPU gets private memory. + */ + size = roundup(size, cache_line_size()); and wonder whether it should have used L1_CACHE_ALIGN(). I think I'd better stop looking. -- 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/