[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <497FFCAE.70503@cosmosbay.com>
Date: Wed, 28 Jan 2009 07:35:26 +0100
From: Eric Dumazet <dada1@...mosbay.com>
To: Stephen Hemminger <shemminger@...tta.com>
CC: David Miller <davem@...emloft.net>,
Patrick McHardy <kaber@...sh.net>, netdev@...r.kernel.org,
netfilter-devel@...r.kernel.org
Subject: Re: [RFT 3/4] netfilter: use sequence number synchronization for
counters
Stephen Hemminger a écrit :
> On Wed, 28 Jan 2009 07:17:04 +0100
> Eric Dumazet <dada1@...mosbay.com> wrote:
>
>
>> Stephen Hemminger a écrit :
>>
>>> Change how synchronization is done on the iptables counters. Use seqcount
>>> wrapper instead of depending on reader/writer lock.
>>>
>>> Signed-off-by: Stephen Hemminger <shemminger@...tta.com>
>>>
>>>
>>>
>>> --- a/net/ipv4/netfilter/ip_tables.c 2009-01-27 14:48:41.567879095 -0800
>>> +++ b/net/ipv4/netfilter/ip_tables.c 2009-01-27 15:45:05.766673246 -0800
>>> @@ -366,7 +366,9 @@ ipt_do_table(struct sk_buff *skb,
>>> if (IPT_MATCH_ITERATE(e, do_match, skb, &mtpar) != 0)
>>> goto no_match;
>>>
>>> + write_seqcount_begin(&e->seq);
>>> ADD_COUNTER(e->counters, ntohs(ip->tot_len), 1);
>>> + write_seqcount_end(&e->seq);
>>>
>>>
>> Its not very good to do it like this, (one seqcount_t per rule per cpu)
>>
>
> If we use one count per table, that solves it, but it becomes a hot
> spot, and on an active machine will never settle.
>
>
One seqcount per table and per cpu.
Only one cpu (the owner) will need to change the seqcount (one increment
when entering ipt_do_table(), one increment when leaving)
This location is only read by the thread doing the "iptables -L". We
dont care it spends a few cycles, it's already a big cruncher.
I dont understand your concern, what do you mean by "never settle" ?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists