From: Stephen Hemminger <shemminger@osdl.org>
To: Eric Dumazet <dada1@cosmosbay.com>
Cc: Harald Welte <laforge@netfilter.org>,
Netfilter Development Mailinglist
<netfilter-devel@lists.netfilter.org>,
Patrick McHardy <kaber@trash.net>
Subject: Re: [PATCH] x_tables : Use SMP friendly (percpu) rwlock_t to protect x_tables
Date: Fri, 27 Jan 2006 07:37:21 -0800 [thread overview]
Message-ID: <20060127073721.1888808f@localhost.localdomain> (raw)
In-Reply-To: <43DA393F.6010801@cosmosbay.com>
On Fri, 27 Jan 2006 16:16:15 +0100
Eric Dumazet <dada1@cosmosbay.com> wrote:
> This patch helps scalability of x_tables on SMP, especially NUMA machines.
>
> Instead of using a single rwlock_t to protect x_tables, use an array of
> rwlock_t, one for each possible cpu in the machine.
>
> 1) No more cache line ping pongs between cpus. read_lock_bh(&table->lock) /
> read_unlock_bh(&table->lock) were still expensive because of the very hot
> central rwlock.
>
> 2) get_counters() is more latency friendly than before (we lock each sub table
> one at a time instead of the full x_tables)
>
> 3) When a replace of table must be done, the 'writer' have to write_lock_bh()
> all the locks of the array. This is 'expensive' but seldom done (underlying
> vmalloc/copy_from_user costs are more expensive anyway)
>
> This patch was tested on a 4 way Opteron machine, two gigabit links, with
> rather complex iptables rules (around 200 rules) and gives excellent results
> so far.
>
>
> Thank you
> Eric Dumazet
>
> Signed-off-by: Eric Dumazet <dada1@cosmosbay.com>
>
You just reinvented brlock. Figure out how to use atomic operations and/or RCU
and you will do even better.
next prev parent reply other threads:[~2006-01-27 15:37 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-08 21:26 [PATCH] x_tables, take 5 (Final Review) Harald Welte
2006-01-08 22:08 ` Patrick McHardy
2006-01-08 22:12 ` Patrick McHardy
2006-01-08 23:01 ` Patrick McHardy
2006-01-09 9:19 ` Harald Welte
2006-01-09 6:46 ` Patrick McHardy
2006-01-09 8:59 ` Harald Welte
2006-01-09 8:52 ` Yasuyuki KOZAKAI
[not found] ` <200601090852.k098qjeO004027@toshiba.co.jp>
2006-01-09 10:35 ` Harald Welte
2006-01-10 4:18 ` Yasuyuki KOZAKAI
[not found] ` <200601100418.k0A4IxhL008706@toshiba.co.jp>
2006-01-12 16:58 ` Harald Welte
2006-01-09 11:23 ` Eric Dumazet
2006-01-09 13:15 ` Harald Welte
2006-01-27 15:16 ` [PATCH] x_tables : Use SMP friendly (percpu) rwlock_t to protect x_tables Eric Dumazet
2006-01-27 15:37 ` Stephen Hemminger [this message]
2006-01-27 15:46 ` Eric Dumazet
2006-01-27 17:53 ` Stephen Hemminger
2006-01-27 21:51 ` Eric Dumazet
2006-01-27 16:06 ` Eric Dumazet
2006-01-09 17:44 ` [PATCH] x_tables, take 5 (Final Review) Yasuyuki KOZAKAI
[not found] ` <200601091744.k09HiVP2022456@toshiba.co.jp>
2006-01-12 16:02 ` Harald Welte
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=20060127073721.1888808f@localhost.localdomain \
--to=shemminger@osdl.org \
--cc=dada1@cosmosbay.com \
--cc=kaber@trash.net \
--cc=laforge@netfilter.org \
--cc=netfilter-devel@lists.netfilter.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.