Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761309AbYCGCFE (ORCPT ); Thu, 6 Mar 2008 21:05:04 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754372AbYCGCEu (ORCPT ); Thu, 6 Mar 2008 21:04:50 -0500 Received: from ns.suse.de ([195.135.220.2]:49327 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754233AbYCGCEq (ORCPT ); Thu, 6 Mar 2008 21:04:46 -0500 Date: Fri, 7 Mar 2008 03:04:43 +0100 From: Nick Piggin To: Christoph Lameter Cc: Pekka Enberg , netdev@vger.kernel.org, Linux Kernel Mailing List , yanmin_zhang@linux.intel.com, David Miller , Eric Dumazet Subject: Re: [rfc][patch 1/3] slub: fix small HWCACHE_ALIGN alignment Message-ID: <20080307020443.GA21185@wotan.suse.de> References: <20080303201701.GF8974@wotan.suse.de> <84144f020803031330i2c0ea1f6kc5b02c8b26145797@mail.gmail.com> <47CC6F30.50802@cs.helsinki.fi> <20080305002821.GD1510@wotan.suse.de> <20080306024904.GA27150@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1378 Lines: 42 On Thu, Mar 06, 2008 at 02:53:11PM -0800, Christoph Lameter wrote: > On Thu, 6 Mar 2008, Nick Piggin wrote: > > > > That was due to SLUB's support for smaller allocation sizes. AFAICT has > > > nothing to do with alignment. > > > > The smaller sizes meant objects were less often aligned on cacheline > > boundaries. > > Right since SLAB_HWCACHE_ALIGN does not align for very small objects. It doesn't align small objects to cacheline boundaries in either allocator. The regression is just because slub can support smaller sizes of objects AFAIKS. > > We could, but I'd rather just use the flag. > > Do you have a case in mind where that would be useful? We had a Patch 3/3 > SLAB_HWCACHE_MUST_ALIGN or so at some point but it was rarely to never > used. OK, but that's not the same thing. > Note that there is also KMEM_CACHE which picks up the alignment from > the compiler. Yeah, that's not quite as good either. My allocation flag is dynamic, so it will not bloat things for no reason on UP machines and SMP kernels. It also aligns to the detected machine cacheline size rather than a compile time constant. -- 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/