[ovs-dev] [PATCH RFC] dpif-netlink: distribute polling to discreet handlers
Aaron Conole
aconole at redhat.com
Fri Jun 26 13:53:53 UTC 2020
Matteo Croce <technoboy85 at gmail.com> writes:
> On Wed, Jun 24, 2020 at 3:48 PM Aaron Conole <aconole at redhat.com> wrote:
>>
>> Currently, the channel handlers are polled globally. On some
>> systems, this causes a thundering herd issue where multiple
>> handler threads become active, only to do no work and immediately
>> sleep.
>>
>> The approach here is to push the netlink socket channels to discreet
>> handler threads to process, rather than polling on every thread.
>> This will eliminate the need to wake multiple threads.
>>
>> To check:
>>
>> ip netns add left
>> ip netns add right
>> ip link add center-left type veth peer name left0
>> ip link add center-right type veth peer name right0
>> ip link set left0 netns left
>> ip link set right0 netns right
>> ip link set center-left up
>> ip link set center-right up
>> ip netns exec left ip link set left0 up
>> ip netns exec left ip addr add 172.31.110.10/24 dev left0
>> ip netns exec right ip link set right0 up
>> ip netns exec right ip addr add 172.31.110.11/24 dev right0
>>
>> ovs-vsctl add-br br0
>> ovs-vsctl add-port br0 center-right
>> ovs-vsctl add-port br0 center-left
>>
>> # in one terminal
>> perf record -e sched:sched_wakeup,irq:softirq_entry -ag
>>
>> # in a separate terminal
>> ip netns exec left arping -I left0 -c 1 172.31.110.11
>>
>> # in the perf terminal after exiting
>> perf script
>>
>> Look for the number of 'handler' threads which were made active.
>>
>> Reported-by: David Ahern <dsahern at gmail.com>
>> Reported-at: https://mail.openvswitch.org/pipermail/ovs-dev/2019-December/365857.html
>> Cc: Matteo Croce <technoboy85 at gmail.com>
>> Cc: Flavio Leitner <fbl at sysclose.org>
>> Signed-off-by: Aaron Conole <aconole at redhat.com>
>>
>
> Great work!
>
> Just to understand, this reverts some logic of my patch, and
> transposes the threads and sockets?
Yes.
> Maybe it's the case to add a Fixes tag pointing to 69c51582f ?
Okay, I can include it when I post with removing the RFC tag.
> Nitpick: `iproute -n` instead of `ip netns exec` where possible, e.g.
>
> ip netns exec left ip link set left0 up
>
> becomes
>
> ip -n left link set left0 up
Neat!
> Cheers,
More information about the dev
mailing list