Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755232AbZDPXuT (ORCPT ); Thu, 16 Apr 2009 19:50:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754511AbZDPXuA (ORCPT ); Thu, 16 Apr 2009 19:50:00 -0400 Received: from e6.ny.us.ibm.com ([32.97.182.146]:53593 "EHLO e6.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753516AbZDPXt7 (ORCPT ); Thu, 16 Apr 2009 19:49:59 -0400 Date: Thu, 16 Apr 2009 16:49:55 -0700 From: "Paul E. McKenney" To: David Miller Cc: kaber@trash.net, torvalds@linux-foundation.org, shemminger@vyatta.com, dada1@cosmosbay.com, jeff.chua.linux@gmail.com, paulus@samba.org, mingo@elte.hu, laijs@cn.fujitsu.com, jengelh@medozas.de, r000n@r000n.net, linux-kernel@vger.kernel.org, netfilter-devel@vger.kernel.org, netdev@vger.kernel.org, benh@kernel.crashing.org Subject: Re: [PATCH] netfilter: use per-cpu spinlock rather than RCU (v3) Message-ID: <20090416234955.GL6924@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20090415170111.6e1ca264@nehalam> <49E72E83.50702@trash.net> <20090416.153354.170676392.davem@davemloft.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090416.153354.170676392.davem@davemloft.net> User-Agent: Mutt/1.5.15+20070412 (2007-04-11) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1484 Lines: 35 On Thu, Apr 16, 2009 at 03:33:54PM -0700, David Miller wrote: > From: Patrick McHardy > Date: Thu, 16 Apr 2009 15:11:31 +0200 > > > Linus Torvalds wrote: > >> On Wed, 15 Apr 2009, Stephen Hemminger wrote: > >>> The counters are the bigger problem, otherwise we could just free > >>> table > >>> info via rcu. Do we really have to support: replace where the counter > >>> values coming out to user space are always exactly accurate, or is it > >>> allowed to replace a rule and maybe lose some counter ticks (worst > >>> case > >>> NCPU-1). > >> Why not just read the counters fromt he old one at RCU free time (they > >> are guaranteed to be stable at that point, since we're all done with > >> those entries), and apply them at that point to the current setup? > > > > We need the counters immediately to copy them to userspace, so waiting > > for an asynchronous RCU free is not going to work. > > It just occurred to me that since all netfilter packet handling > goes through one place, we could have a sort-of "netfilter RCU" > of sorts to solve this problem. OK, I am putting one together... It will be needed sooner or later, though I suspect per-CPU locking would work fine in this case. Thanx, Paul -- 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/