[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49F1DBAC.8090101@trash.net>
Date: Fri, 24 Apr 2009 17:33:00 +0200
From: Patrick McHardy <kaber@...sh.net>
To: Eric Dumazet <dada1@...mosbay.com>
CC: Stephen Hemminger <shemminger@...tta.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Ingo Molnar <mingo@...e.hu>, Paul Mackerras <paulus@...ba.org>,
paulmck@...ux.vnet.ibm.com, Evgeniy Polyakov <zbr@...emap.net>,
David Miller <davem@...emloft.net>, jeff.chua.linux@...il.com,
laijs@...fujitsu.com, jengelh@...ozas.de, r000n@...0n.net,
linux-kernel@...r.kernel.org, netfilter-devel@...r.kernel.org,
netdev@...r.kernel.org, benh@...nel.crashing.org,
mathieu.desnoyers@...ymtl.ca
Subject: Re: [PATCH] netfilter: use per-CPU recursive lock {XIV}
Eric Dumazet wrote:
> Stephen Hemminger a écrit :
>> In days of old in 2.6.29, netfilter did locketh using a
>> lock of the reader kind when doing its table business, and do
>> a writer when with pen in hand like a overworked accountant
>> did replace the tables. This sucketh and caused the single
>> lock to fly back and forth like a poor errant boy.
>>
>> But then netfilter was blessed with RCU and the performance
>> was divine, but alas there were those that suffered for
>> trying to replace their many rules one at a time.
>>
>> So now RCU must be vanquished from the scene, and better
>> chastity belts be placed upon this valuable asset most dear.
>> The locks that were but one are now replaced by one per suitor.
>>
>> The repair was made after much discussion involving
>> Eric the wise, and Linus the foul. With flowers springing
>> up amid the thorns some peace has finally prevailed and
>> all is soothed. This patch and purple prose was penned by
>> in honor of "Talk like Shakespeare" day.
Hehe.
>> static int __init xt_init(void)
>> {
>> - int i, rv;
>> + unsigned int i;
>> + int rv;
>> + static struct lock_class_key xt_lock_key[NR_CPUS];
>
> Could we avoid this [NR_CPUS] thing ?
>
>> +
>> + for_each_possible_cpu(i) {
>> + rwlock_t *lock = &per_cpu(xt_info_locks, i);
>> +
>> + rwlock_init(lock);
>> + lockdep_set_class(lock, xt_lock_key+i);
>> + }
>
>
> Did you tried :
>
> static DECLARE_PER_CPU(struct lock_class_key, xt_locks_key);
Either way is fine with me, I'll wait for Stephen to state his opinion.
--
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