Re: SO_REUSEPORT - can it be done in kernel?

Eric Dumazet
2011-02-28T13:32:56Z

Le lundi 28 février 2011 à 19:36 +0800, Herbert Xu a écrit :
> On Sun, Feb 27, 2011 at 07:06:14PM +0800, Herbert Xu wrote:
> > I'm working on this right now.
>
> OK I think I was definitely on the right track. With the send
> patch made lockless I now get numbers which are even better than
> those obtained with running named with multiple sockets. That's
> right, a single socket is now faster than what multiple sockets
> were without the patch (of course, multiple sockets may still
> faster with the patch vs. a single socket for obvious reasons,
> but I couldn't measure any significant difference).
>
> Also worthy of note is that prior to the patch all CPUs showed
> idleness (lazy bastards!), with the patch they're all maxed out.
>
> In retrospect, the idleness was simply the result of the socket
> lock scheduling away and was an indication of lock contention.
>

Now, input path can run without finding socket locked by xmit path, so
skb are queued into receive queue, not backlog one.

> Here are the patches I used. Please don't them yet as I intend
> to clean them up quite a bit.
>
> But please do test them heavily, especially if you have an AMD
> NUMA machine as that's where scalability problems really show
> up. Intel tends to be a lot more forgiving. My last AMD machine
> blew up years ago :)

I am going to test them, thanks !