From: Rick Jones <rick.jones2@hp.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: Patrick McHardy <kaber@trash.net>,
Eric Dumazet <dada1@cosmosbay.com>,
David Miller <davem@davemloft.net>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
netdev@vger.kernel.org, netfilter-devel@vger.kernel.org
Subject: Re: [RFC] iptables: lock free counters (v0.6)
Date: Tue, 10 Feb 2009 14:20:30 -0800 [thread overview]
Message-ID: <4991FDAE.9060006@hp.com> (raw)
In-Reply-To: <20090210095220.3e1350a1@extreme>
Stephen Hemminger wrote:
> The reader/writer lock in ip_tables is acquired in the critical path of
> processing packets and is one of the reasons just loading iptables can cause
> a 20% performance loss. The rwlock serves two functions:
>
> 1) it prevents changes to table state (xt_replace) while table is in use.
> This is now handled by doing rcu on the xt_table. When table is
> replaced, the new table(s) are put in and the old one table(s) are freed
> after RCU period.
>
> 2) it provides synchronization when accesing the counter values.
> This is now handled by swapping in new table_info entries for each cpu
> then summing the old values, and putting the result back onto one
> cpu. On a busy system it may cause sampling to occur at different
> times on each cpu, but no packet/byte counts are lost in the process.
I've taken this round for a spin on the 32-core setup. I'd not previously
applied Patrick's patches to remove the initialization, so my kludges to compile
may have altered things, but assuming it was OK (convert the inits to
__MUTEX_INITIALIZER to make the compiler happy) it appears that this change does
very good things indeed for the "empty" case. Where the
2.6.29-rc2/unpatchednet-next showed a 50% drop (handwaving math) in the "empty"
case compared to the "none" case (aka none is no iptables modules loaded, empty
being what one gets after iptables --list) this patch shows what appears to be a
much much smaller drop of less than 6%.
The original data can be seen at:
ftp://ftp.netperf.org/iptable_scaling/ in no_iptables and empty_iptables
and the data after this patch can be seen at:
ftp://ftp.netperf.org/hemminger/hemminger6/ in none and empty
while I have none of Eric's patches in this tree, just for grins I went ahead and
ran "full" as well.
happy benchmarking,
rick jones
next prev parent reply other threads:[~2009-02-10 22:20 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20090204001202.724266235@vyatta.com>
2009-02-04 1:40 ` [RFT 0/3] netfilter: lock free tables Rick Jones
[not found] ` <20090204001755.808036408@vyatta.com>
2009-02-04 3:10 ` [RFT 3/3] iptables: lock free counters Eric Dumazet
2009-02-09 15:52 ` Patrick McHardy
2009-02-09 17:14 ` Stephen Hemminger
2009-02-10 17:52 ` [RFC] iptables: lock free counters (v0.6) Stephen Hemminger
2009-02-10 22:14 ` Ranjit Manomohan
2009-02-10 22:20 ` Rick Jones [this message]
2009-02-09 15:58 ` [RFT 3/3] iptables: lock free counters Patrick McHardy
[not found] ` <20090204001755.685385465@vyatta.com>
2009-02-09 15:37 ` [RFT 2/3] netfilter: remove unneeded initializations Patrick McHardy
2009-02-09 16:23 ` Stephen Hemminger
2009-02-09 16:25 ` Patrick McHardy
2009-02-09 16:24 ` [PATCH] ebtables: " Stephen Hemminger
2009-02-09 16:30 ` Patrick McHardy
2009-02-09 16:28 ` [RFT 2/3] netfilter: " Patrick McHardy
[not found] ` <20090204001755.549902016@vyatta.com>
2009-02-09 16:27 ` [RFT 1/3] netfilter: change elements in x_tables Patrick McHardy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4991FDAE.9060006@hp.com \
--to=rick.jones2@hp.com \
--cc=dada1@cosmosbay.com \
--cc=davem@davemloft.net \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=shemminger@vyatta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).