Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756804AbYLEUcT (ORCPT ); Fri, 5 Dec 2008 15:32:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752660AbYLEUcE (ORCPT ); Fri, 5 Dec 2008 15:32:04 -0500 Received: from 74-93-104-97-Washington.hfc.comcastbusiness.net ([74.93.104.97]:51325 "EHLO sunset.davemloft.net" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1752478AbYLEUcC (ORCPT ); Fri, 5 Dec 2008 15:32:02 -0500 Date: Fri, 05 Dec 2008 12:32:02 -0800 (PST) Message-Id: <20081205.123202.98853955.davem@davemloft.net> To: dada1@cosmosbay.com Cc: akpm@linux-foundation.org, a.p.zijlstra@chello.nl, travis@sgi.com, linux-kernel@vger.kernel.org, cl@linux-foundation.org, linux-ext4@vger.kernel.org Subject: Re: [PATCH] percpu_counter: FBC_BATCH might be too big From: David Miller In-Reply-To: <4939513C.3090101@cosmosbay.com> References: <4939513C.3090101@cosmosbay.com> X-Mailer: Mew version 6.1 on Emacs 22.1 / Mule 5.0 (SAKAKI) 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: 954 Lines: 24 From: Eric Dumazet Date: Fri, 05 Dec 2008 17:05:16 +0100 > For NR_CPUS >= 16 values, FBC_BATCH is 2*NR_CPUS > > Considering more and more distros are using high NR_CPUS values, > it makes sense to use a more sensible value for FBC_BATCH. > > A sensible value is 2*num_online_cpus(), with a minimum value of 32 > (This minimum value helps branch prediction in __percpu_counter_add()) > > We already have a hotcpu notifier, so we can adjust FBC_BATCH dynamically. > > Signed-off-by: Eric Dumazet The downside is now we must load this value in these common routines. But I think the gain outweights the loss so: Acked-by: David S. Miller -- 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/