[ovs-dev] [PATCH 0/4] Global netdev change_seq

Joe Stringer joestringer at nicira.com
Fri Nov 8 17:41:18 UTC 2013


When dealing with a large number of ports, a major performance bottleneck is
various places in the main loop where all ports are looped through each time
the thread wakes up. This often involves a bunch of lock jiggling and polling
unchanged attributes.

This patchset shifts change_seq out from per-netdevice to a single global
atomic variable tracking all interface changes. This is updated on changes to
netdev attributes, bfd, cfm, and lacp status. This is tracked in ofproto, which
allows us to check before performing per-port processing. Finally, we also skip
bundle processing if there are no bundles present in a bridge.

In a test environment of 5000 internal ports and 50 tunnel ports with bfd, this
reduces CPU usage from about 45% to about 20%. The main case I have tested is
with low traffic and no deliberate changes to port status. I also briefly
tested with a script tightly looping to ifup/ifdown one interface on a bridge.
This case appeared to increase CPU usage by 1-2%.

While this saves a bunch of CPU in this situation, I'm considering whether it
goes far enough. The next bottleneck I see is writing instant stats to the IDL.
For this, it may be useful to break the global change_seq down into netdev,
cfm, bfd, lacp, etc (stp?). I welcome any insight or discussion on this.

Joe Stringer (4):
  netdev: Make naming more consistent
  netdev: Globally track port status changes
  ofproto-dpif: Don't poll ports when nothing changes
  ofproto-dpif: Skip bundle execution when not enabled

 lib/bfd.c                  |    4 ++++
 lib/bond.c                 |    4 ++--
 lib/cfm.c                  |    7 ++++++
 lib/lacp.c                 |    3 +++
 lib/netdev-bsd.c           |   22 ++++---------------
 lib/netdev-dummy.c         |   31 +++++---------------------
 lib/netdev-linux.c         |   23 ++------------------
 lib/netdev-provider.h      |   11 ----------
 lib/netdev-vport.c         |   26 ++++++----------------
 lib/netdev.c               |   52 ++++++++++++++++++++++++++++++++++++--------
 lib/netdev.h               |    4 +++-
 ofproto/ofproto-dpif.c     |   27 +++++++++++++++--------
 ofproto/ofproto-provider.h |    2 +-
 ofproto/ofproto.c          |   49 +++++++++++++++++++----------------------
 ofproto/tunnel.c           |    4 ++--
 15 files changed, 124 insertions(+), 145 deletions(-)

-- 
1.7.9.5




More information about the dev mailing list