All of lore.kernel.org
 help / color / mirror / Atom feed
* per-cpu table information
@ 2004-09-09 10:17 Swapnil Nagle
  2004-09-15 22:36 ` Harald Welte
  0 siblings, 1 reply; 5+ messages in thread
From: Swapnil Nagle @ 2004-09-09 10:17 UTC (permalink / raw)
  To: netfilter-devel


Hi all,

Why is the table information (ipt_table_info to be specific) duplicated 
for each CPU in ipt_table?
Is it required so that new rules can be added simultanously while the 
existing rules are processed ?

Regards,
Swapnil.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: per-cpu table information
  2004-09-09 10:17 per-cpu table information Swapnil Nagle
@ 2004-09-15 22:36 ` Harald Welte
  2004-09-15 22:47   ` David S. Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Harald Welte @ 2004-09-15 22:36 UTC (permalink / raw)
  To: Swapnil Nagle; +Cc: netfilter-devel

[-- Attachment #1: Type: text/plain, Size: 712 bytes --]

On Thu, Sep 09, 2004 at 03:47:02PM +0530, Swapnil Nagle wrote:
> 
> Hi all,
> 
> Why is the table information (ipt_table_info to be specific) duplicated 
> for each CPU in ipt_table?

Because we don't need any locking and we don't have cache line ping-pong
between the CPU's, if there is no shared data.

> Regards,
> Swapnil.

-- 
- Harald Welte <laforge@netfilter.org>             http://www.netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: per-cpu table information
  2004-09-15 22:36 ` Harald Welte
@ 2004-09-15 22:47   ` David S. Miller
  2004-09-16  7:12     ` Harald Welte
  0 siblings, 1 reply; 5+ messages in thread
From: David S. Miller @ 2004-09-15 22:47 UTC (permalink / raw)
  To: Harald Welte; +Cc: netfilter-devel, swapsn

On Thu, 16 Sep 2004 00:36:02 +0200
Harald Welte <laforge@netfilter.org> wrote:

> Because we don't need any locking and we don't have cache line ping-pong
> between the CPU's, if there is no shared data.

In my opinion the disadvantages (both in code complexity and table
update cost) far outweigh whatever speed gains you this obtains.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: per-cpu table information
  2004-09-15 22:47   ` David S. Miller
@ 2004-09-16  7:12     ` Harald Welte
  2004-09-16 19:47       ` David S. Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Harald Welte @ 2004-09-16  7:12 UTC (permalink / raw)
  To: David S. Miller; +Cc: netfilter-devel, swapsn

[-- Attachment #1: Type: text/plain, Size: 1345 bytes --]

On Wed, Sep 15, 2004 at 03:47:38PM -0700, David S. Miller wrote:
> On Thu, 16 Sep 2004 00:36:02 +0200
> Harald Welte <laforge@netfilter.org> wrote:
> 
> > Because we don't need any locking and we don't have cache line ping-pong
> > between the CPU's, if there is no shared data.
> 
> In my opinion the disadvantages (both in code complexity and table
> update cost) far outweigh whatever speed gains you this obtains.

Table update cost is mostly harmed by the atomic replacement of the
whole table, not by one-time copying...

And iptables performance is bad enough, we don't need to make it any
worse (we have per-rule counters that need to be written to!).

Anyway, pkttables will simply have a 'matchinfo/targinfo read only'
policy (everybody who needs a writable memory needs to dynamically
allocate and do his own locking), and not have per-rule countes anymore.
This means the whole ruleset is read-only and we don't need any code
replication.

-- 
- Harald Welte <laforge@netfilter.org>             http://www.netfilter.org/
============================================================================
  "Fragmentation is like classful addressing -- an interesting early
   architectural error that shows how much experimentation was going
   on while IP was being designed."                    -- Paul Vixie

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: per-cpu table information
  2004-09-16  7:12     ` Harald Welte
@ 2004-09-16 19:47       ` David S. Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David S. Miller @ 2004-09-16 19:47 UTC (permalink / raw)
  To: Harald Welte; +Cc: netfilter-devel, swapsn

On Thu, 16 Sep 2004 09:12:02 +0200
Harald Welte <laforge@netfilter.org> wrote:

> Anyway, pkttables will simply have a 'matchinfo/targinfo read only'
> policy (everybody who needs a writable memory needs to dynamically
> allocate and do his own locking), and not have per-rule countes anymore.
> This means the whole ruleset is read-only and we don't need any code
> replication.

Sounds great.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-09-16 19:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-09 10:17 per-cpu table information Swapnil Nagle
2004-09-15 22:36 ` Harald Welte
2004-09-15 22:47   ` David S. Miller
2004-09-16  7:12     ` Harald Welte
2004-09-16 19:47       ` David S. Miller

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.