per-cpu table information
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.
Quoted 5 lines · Swapnil Nagle
Hi all,
Why is the table information (
ipt_table_infoto be specific) duplicated for each CPU inipt_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.
Quoted 2 lines
Regards,
Swapnil.
Signature · 5 lines
- Harald Welte <[email protected]> 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
Quoted 2 lines · On Thu, 16 Sep 2004 00:36:02 +0200 Harald Welte <[email protected]> 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.
Quoted 8 lines · David S. Miller
Quoted 2 lines · On Thu, 16 Sep 2004 00:36:02 +0200 Harald Welte <[email protected]> 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.
Signature · 5 lines
- Harald Welte <[email protected]> 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
Quoted 5 lines · On Thu, 16 Sep 2004 09:12:02 +0200 Harald Welte <[email protected]> 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.