From patchwork Tue Jun 23 15:04:44 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Dangaard Brouer X-Patchwork-Id: 29079 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id B74A3B70A7 for ; Wed, 24 Jun 2009 01:31:29 +1000 (EST) Received: by ozlabs.org (Postfix) id AA8A3DDDF6; Wed, 24 Jun 2009 01:31:29 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 2D0A6DDDF0 for ; Wed, 24 Jun 2009 01:31:29 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757431AbZFWPa1 (ORCPT ); Tue, 23 Jun 2009 11:30:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758237AbZFWP3w (ORCPT ); Tue, 23 Jun 2009 11:29:52 -0400 Received: from lanfw001a.cxnet.dk ([87.72.215.196]:49566 "EHLO lanfw001a.cxnet.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752653AbZFWP3s (ORCPT ); Tue, 23 Jun 2009 11:29:48 -0400 Received: from hotlava.cxnet.dk (unknown [172.31.4.152]) by lanfw001a.cxnet.dk (Postfix) with ESMTP id A46BC16385F; Tue, 23 Jun 2009 17:04:44 +0200 (CEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) by hotlava.cxnet.dk (Postfix) with ESMTP id 95A0845C068; Tue, 23 Jun 2009 17:04:44 +0200 (CEST) From: Jesper Dangaard Brouer Subject: [PATCH 10/10] nf_conntrack: Use rcu_barrier(). To: "David S. Miller" Cc: Jesper Dangaard Brouer , "Paul E. McKenney" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, dougthompson@xmission.com, bluesmoke-devel@lists.sourceforge.net, axboe@kernel.dk, "Patrick McHardy" , christine.caulfield@googlemail.com, Trond.Myklebust@netapp.com, linux-wireless@vger.kernel.org, johannes@sipsolutions.net, yoshfuji@linux-ipv6.org, shemminger@linux-foundation.org, linux-nfs@vger.kernel.org, bfields@fieldses.org, neilb@suse.de, linux-ext4@vger.kernel.org, tytso@mit.edu, adilger@sun.com, netfilter-devel@vger.kernel.org Date: Tue, 23 Jun 2009 17:04:44 +0200 Message-ID: <20090623150444.22490.27931.stgit@localhost> In-Reply-To: <20090623150330.22490.87327.stgit@localhost> References: <20090623150330.22490.87327.stgit@localhost> User-Agent: StGIT/0.14.2 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org I'm not sure which is are most optimal place to call rcu_barrier(). The patch probably calls rcu_barrier() too much, but its a better safe than sorry approach. There is embedded some comments that I would like Patrick McHardy to look at. Signed-off-by: Jesper Dangaard Brouer --- net/netfilter/nf_conntrack_core.c | 5 +++++ net/netfilter/nf_conntrack_standalone.c | 2 ++ 2 files changed, 7 insertions(+), 0 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 5f72b94..cea4537 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c @@ -1084,6 +1084,8 @@ static void nf_conntrack_cleanup_init_net(void) { nf_conntrack_helper_fini(); nf_conntrack_proto_fini(); + rcu_barrier(); + /* Need to wait for call_rcu() before dealloc the kmem_cache */ kmem_cache_destroy(nf_conntrack_cachep); } @@ -1118,6 +1120,9 @@ void nf_conntrack_cleanup(struct net *net) /* This makes sure all current packets have passed through netfilter framework. Roll on, two-stage module delete... */ + /* hawk@comx.dk 2009-06-20: Think this should be replaced by a + rcu_barrier() ??? + */ synchronize_net(); nf_conntrack_cleanup_net(net); diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c index 1935153..29c6cd0 100644 --- a/net/netfilter/nf_conntrack_standalone.c +++ b/net/netfilter/nf_conntrack_standalone.c @@ -500,6 +500,8 @@ static void nf_conntrack_net_exit(struct net *net) nf_conntrack_standalone_fini_sysctl(net); nf_conntrack_standalone_fini_proc(net); nf_conntrack_cleanup(net); + /* hawk@comx.dk: Think rcu_barrier() should to be called earlier? */ + rcu_barrier(); /* Wait for completion of call_rcu()'s */ } static struct pernet_operations nf_conntrack_net_ops = {