Re: SO_REUSEPORT - can it be done in kernel?

Eric Dumazet
2011-03-01T13:54:45Z

Le mardi 01 mars 2011 à 21:18 +0800, Herbert Xu a écrit :

> Interesting. So I wonder which lock is showing up at the top
> of the profile with a single socket then. As it's definitely
> going away with multiple sockets, that means it's not the TX
> queue lock.
>

This CPU also runs named process, so this is socket lock and receive
queue lock.

Named threads all do : recvmsg()/sendmsg() in a loop, so all are waiting
a frame before doing some work.

Because of single receive queue, extra context switches occur (all
threads but one have to sleep again per query)

For about 80 kqps (standard linux-2.6 kernel, no patches), I have
following vmstat output

procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
4 1 0 2184048 63496 1595056 0 0 0 2060 64592 294528 19 11 67 4
6 1 0 2184040 63496 1595056 0 0 0 1960 64686 293928 19 11 66 4
3 1 0 2184040 63496 1595056 0 0 0 2344 64556 294268 20 11 66 4
4 1 0 2184040 63496 1595056 0 0 0 2400 64626 293859 19 11 67 4