]> git.proxmox.com Git - mirror_ovs.git/commit
dpif-netdev: Do RCU synchronization at fixed interval in PMD main loop.
authorNitin Katiyar <nitin.katiyar@ericsson.com>
Thu, 22 Aug 2019 16:53:30 +0000 (22:23 +0530)
committerIlya Maximets <i.maximets@ovn.org>
Tue, 7 Jul 2020 15:23:54 +0000 (17:23 +0200)
commit81ac8b3b194c602e7c9b4095f5bc1e214ae72a32
treef5cf47eedf27601b022a27b58fe591505acfac6d
parent9ed69557e5fae4f33f34a985c380e7e040b09548
dpif-netdev: Do RCU synchronization at fixed interval in PMD main loop.

Each PMD updates the global sequence number for RCU synchronization
purpose with other OVS threads. This is done at every 1025th iteration
in PMD main loop.

If the PMD thread is responsible for polling large number of queues
that are carrying traffic, it spends a lot of time processing packets
and this results in significant delay in performing the housekeeping
activities.

If the OVS main thread is waiting to synchronize with the PMD threads
and if those threads delay performing housekeeping activities for
more than 3 sec then LACP processing will be impacted and it will lead
to LACP flaps. Similarly, other controls protocols run by OVS main
thread are impacted.

For e.g. a PMD thread polling 200 ports/queues with average of 1600
processing cycles per packet with batch size of 32 may take 10240000
(200 * 1600 * 32) cycles per iteration. In system with 2.0 GHz CPU
it means more than 5 ms per iteration. So, for 1024 iterations to
complete it would be more than 5 seconds.

This gets worse when there are PMD threads which are less loaded.
It reduces possibility of getting mutex lock in ovsrcu_try_quiesce()
by heavily loaded PMD and next attempt to quiesce would be after 1024
iterations.

With this patch, PMD RCU synchronization will be performed after fixed
interval instead after a fixed number of iterations. This will ensure
that even if the packet processing load is high the RCU synchronization
will not be delayed long.

Co-authored-by: Anju Thomas <anju.thomas@ericsson.com>
Signed-off-by: Anju Thomas <anju.thomas@ericsson.com>
Signed-off-by: Nitin Katiyar <nitin.katiyar@ericsson.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
lib/dpif-netdev.c