[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 9 Sep 2010 06:42:22 +0000
From: Jarek Poplawski <jarkao2@...il.com>
To: David Miller <davem@...emloft.net>
Cc: jesse@...ira.com, eric.dumazet@...il.com, netdev@...r.kernel.org
Subject: Re: [PATCH net-next-2.6] net: inet_add_protocol() can use cmpxchg()
On 2010-09-09 06:30, David Miller wrote:
> From: Jesse Gross <jesse@...ira.com>
> Date: Wed, 8 Sep 2010 16:49:27 -0700
>
>> On Wed, Sep 8, 2010 at 3:56 PM, Eric Dumazet <eric.dumazet@...il.com> wrote:
>>> Use cmpxchg() to get rid of spinlocks in inet_add_protocol() and
>>> friends.
>>>
>>> inet_protos[] & inet6_protos[] are moved to read_mostly section
>>>
>>> Signed-off-by: Eric Dumazet <eric.dumazet@...il.com>
>>
>> What's the benefit to this? It's hard to imagine that add/deleting
>> protocols is highly contended. On the other hand, a simple spinlock
>> is very easy to look at and verify correct, while this takes a little
>> more thought.
>
> Smaller data section is the benefit, thus less cache pressure there.
>
Of course, each case is different, but generally I understand Jesse's
concern. Smaller data section argument shouldn't be enough. There is
some reason we do it in C not asm, and there is some cost of
unreadable code too.
Jarek P.
--
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