Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758503AbYB0Toy (ORCPT ); Wed, 27 Feb 2008 14:44:54 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755206AbYB0Too (ORCPT ); Wed, 27 Feb 2008 14:44:44 -0500 Received: from netops-testserver-3-out.sgi.com ([192.48.171.28]:44233 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756746AbYB0Ton (ORCPT ); Wed, 27 Feb 2008 14:44:43 -0500 Date: Wed, 27 Feb 2008 11:44:42 -0800 (PST) From: Christoph Lameter X-X-Sender: clameter@schroedinger.engr.sgi.com To: Nick Piggin cc: Peter Zijlstra , Eric Dumazet , "David S. Miller" , Andrew Morton , linux kernel , netdev@vger.kernel.org, "Zhang, Yanmin" Subject: Re: [PATCH] alloc_percpu() fails to allocate percpu data In-Reply-To: <200802232023.52352.nickpiggin@yahoo.com.au> Message-ID: References: <47BDBC23.10605@cosmosbay.com> <1203632765.6112.20.camel@lappy> <200802232023.52352.nickpiggin@yahoo.com.au> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1315 Lines: 34 On Sat, 23 Feb 2008, Nick Piggin wrote: > What I don't understand is why the slab allocators have something like > this in it: > > if ((flags & SLAB_HWCACHE_ALIGN) && > size > cache_line_size() / 2) > return max_t(unsigned long, align, cache_line_size()); > > If you ask for HWCACHE_ALIGN, then you should get it. I don't > understand, why do they think they knows better than the caller? Tradition.... Its irks me as well. > Things like this are just going to lead to very difficult to track > performance problems. Possibly correctness problems in rare cases. > > There could be another flag for "maybe align". SLAB_HWCACHE_ALIGN *is* effectively a maybe align flag given the above code. If we all agree then we could change this to have must have semantics? It has the potential of enlarging objects for small caches. SLAB_HWCACHE_ALIGN has an effect that varies according to the alignment requirements of the architecture that the kernel is build on. We may be in for some surprises if we change this. -- 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/