Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764615AbZAUMqR (ORCPT ); Wed, 21 Jan 2009 07:46:17 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1759214AbZAUMp5 (ORCPT ); Wed, 21 Jan 2009 07:45:57 -0500 Received: from mail.vyatta.com ([76.74.103.46]:50043 "EHLO mail.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758961AbZAUMp4 (ORCPT ); Wed, 21 Jan 2009 07:45:56 -0500 Date: Wed, 21 Jan 2009 23:45:01 +1100 From: Stephen Hemminger To: ebiederm@xmission.com (Eric W. Biederman) Cc: Tejun Heo , Ingo Molnar , Rusty Russell , Herbert Xu , akpm@linux-foundation.org, hpa@zytor.com, brgerst@gmail.com, cl@linux-foundation.org, travis@sgi.com, linux-kernel@vger.kernel.org, steiner@sgi.com, hugh@veritas.com, "David S. Miller" , netdev@vger.kernel.org, Mathieu Desnoyers Subject: Re: [PATCH] percpu: add optimized generic percpu accessors Message-ID: <20090121234502.66acbcf9@s6510> In-Reply-To: References: <20090115183942.GA6325@elte.hu> <200901170827.33729.rusty@rustcorp.com.au> <20090116220832.GB20653@elte.hu> <200901201328.24605.rusty@rustcorp.com.au> <20090120104022.GB29346@elte.hu> <4976B82E.1080002@kernel.org> Organization: Vyatta X-Mailer: Claws Mail 3.6.1 (GTK+ 2.14.5; i386-redhat-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: 1496 Lines: 32 On Wed, 21 Jan 2009 03:21:23 -0800 ebiederm@xmission.com (Eric W. Biederman) wrote: > Tejun Heo writes: > > > Ingo Molnar wrote: > >> The larger point still remains: the kernel dominantly uses static percpu > >> variables by a margin of 10 to 1, so we cannot just brush away the static > >> percpu variables and must concentrate on optimizing that side with > >> priority. It's nice if the dynamic percpu-alloc side improves as well, of > >> course. > > > > Well, the infrequent usage of dynamic percpu allocation is in some > > part due to the poor implementation, so it's sort of chicken and egg > > problem. I got into this percpu thing because I wanted a percpu > > reference count which can be dynamically allocated and it sucked. > > Counters are our other special case, and counters are interesting > because they are individually very small. I just looked and the vast > majority of the alloc_percpu users are counters. > > I just did a rough count in include/linux/snmp.h and I came > up with 171*2 counters. At 8 bytes per counter that is roughly > 2.7K. Or about two thirds of a 4K page. This is crap. only a small fraction of these SNMP counters are close enough to the hot path to deserve per-cpu treatment. -- 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/