From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: RFC: conntrack: use mod_timer_pending() Date: Wed, 10 Jun 2009 08:07:46 -0700 Message-ID: <20090610080746.207d0ae2@nehalam> References: <4A2FAFB4.1050100@trash.net> <4A2FAFF6.50909@trash.net> <20090610075133.2dd04e7d@nehalam> <4A2FC8DA.3090904@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Netfilter Development Mailinglist , Martin Josefsson To: Patrick McHardy Return-path: Received: from mail.vyatta.com ([76.74.103.46]:53125 "EHLO mail.vyatta.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754937AbZFJPHt (ORCPT ); Wed, 10 Jun 2009 11:07:49 -0400 In-Reply-To: <4A2FC8DA.3090904@trash.net> Sender: netfilter-devel-owner@vger.kernel.org List-ID: On Wed, 10 Jun 2009 16:53:14 +0200 Patrick McHardy wrote: > Stephen Hemminger wrote: > > On Wed, 10 Jun 2009 15:07:02 +0200 > > Patrick McHardy wrote: > > > >> Patrick McHardy wrote: > >>> This patch changes conntrack to use the new mod_timer_pending() > >>> function, which only rearms the timer if it was still active. > >>> This allows to only grab the lock in __nf_ct_refresh_acct when > >>> accounting is used. > >>> > >>> Anyone seing anything wrong with this? > >>> if (acct) { > >>> + spin_lock_bh(&nf_conntrack_lock); > >>> acct[CTINFO2DIR(ctinfo)].packets++; > >>> acct[CTINFO2DIR(ctinfo)].bytes += > >>> skb->len - skb_network_offset(skb); > >>> + spin_unlock_bh(&nf_conntrack_lock); > >>> } > >> In fact, we could additionally change it to use the per-conntrack lock. > > > > That is what the conntrack RCU patch did. > > Could you remind me which one exactly? There have been a lot of > patches passed around :) > > Sorry, got confused, the patch I was thinking of was for the TCP conntrack lock. --