Subject: Re: Regression caused by commit "netfilter: iptables: lock free counters"

From: Eric Dumazet <[email-masked]>
Date: Sun, 05 Apr 2009 14:34:50 +0200

Jan Engelhardt a écrit :
> On Sunday 2009-04-05 12:01, Eric Dumazet wrote:
>> This could probably be solved using a single "table" containing
>> rules only, that could be shared for every cpus. Only counters
>> should be percpu. This should save a lot of ram, over previous
>> situation (2.6.29 or current one)
> 
> Why would counters stay separate?
> 
> I recognize all of this table copying is related to do NUMA
> optimizations, and I think I heard cache bouncing too somewhere else.
> 
> [ http://marc.info/?l=netfilter-devel&m=119903624211253&w=2 ]
> 
> 

Not only NUMA, but SMP too. counters are integrated in rules themselves.
So in order to avoid ping pongs between cpus, we choose to allocate
one copy of rules/counters per cpu.

But with some changes, we could let the rules read-only and shared by
all cpus, and shadow counters only on percpu variables, thus reducing
memory costs.

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to [email-masked]
More majordomo info at  http://vger.kernel.org/majordomo-info.html