From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick McHardy Subject: Re: [PATCH 3/3] nfnetlink_queue: use hash table to speed up entry finding. Date: Thu, 15 Apr 2010 17:05:15 +0200 Message-ID: <4BC72B2B.9010104@trash.net> References: <4BBEA97A.5020303@gmail.com> <1271162669.16881.301.camel@edumazet-laptop> <1271164991.16881.346.camel@edumazet-laptop> <4BC470B3.4030007@trash.net> <4BC6EC15.4070205@trash.net> <4BC72572.1050507@trash.net> <4BC726B4.1030003@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: Eric Dumazet , netfilter-devel@vger.kernel.org To: Changli Gao Return-path: Received: from stinky.trash.net ([213.144.137.162]:33361 "EHLO stinky.trash.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753779Ab0DOPFR (ORCPT ); Thu, 15 Apr 2010 11:05:17 -0400 In-Reply-To: Sender: netfilter-devel-owner@vger.kernel.org List-ID: Changli Gao wrote: > On Thu, Apr 15, 2010 at 10:46 PM, Patrick McHardy wrote: >> Patrick McHardy wrote: >>> That should be easily fixable. For the lookup we can add a reference >>> counter so we don't need the rcu read side critical section. >> Actually we don't even need that, since we're holding nfnl_mutex the >> instance can't go away. >> > > I don't think so. a netlink queue instance maybe destroyed by > nfqnl_rcv_nl_event(). And the function is called by netlink directly > without nfnl_mutex. No its not: static void nfnetlink_rcv(struct sk_buff *skb) { nfnl_lock(); netlink_rcv_skb(skb, &nfnetlink_rcv_msg); nfnl_unlock(); }