sr-iov device scanning takes significant time

Bug #1653880 reported by Kevin Benton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Kevin Benton

Bug Description

The excessive calls to 'ip link show' can consume significant amounts of CPU cycles on every scan_devices iteration on densely packed SR-IOV systems.

Snip from https://bugs.launchpad.net/mos/+bug/1653131 :

On a node with SR-IOV interfaces neutron-sriov-agent seems to call 'ip link show' every 2 second for each interface. This leads to CPU utilization up to 60+% (I've seen 32% for neutron-rootwrap and 32% for neutron-sriov-nic-agent)

Since output of `ip link show' is the same for all interfaces, it is enough to call it only once per 2 sec interval

root@node-7:~# grep '15:10:' /var/log/neutron/neutron-sriov-agent.log | grep "'ip', 'link', 'show'" | wc -l
5783

Changed in neutron:
assignee: nobody → Kevin Benton (kevinbenton)
importance: Undecided → High
Changed in neutron:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/416523

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (stable/mitaka)

Fix proposed to branch: stable/mitaka
Review: https://review.openstack.org/416524

Changed in neutron:
assignee: Kevin Benton (kevinbenton) → Armando Migliaccio (armando-migliaccio)
Changed in neutron:
assignee: Armando Migliaccio (armando-migliaccio) → Kevin Benton (kevinbenton)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/416400
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=9a022e7d7b85b7c21cf26698fe59c818c4577194
Submitter: Jenkins
Branch: master

commit 9a022e7d7b85b7c21cf26698fe59c818c4577194
Author: Kevin Benton <email address hidden>
Date: Tue Jan 3 18:10:36 2017 -0800

    Reduce IP link show calls for SR-IOV scan loop

    The device scanning logic was calling 'ip link show' for every
    vf_index on the system, which was taking an excessive amount of
    time an CPU cycles on very dense SR-IOV servers (>64 interfaces).
    This was being executed every 2 seconds so it would cause the
    agent to take a large percentage of the CPU time.

    This patch adjusts the logic to use two 'ip link show' commands for
    checking all of the operations in a single get_assigned_devices_info
    call.

    Closes-Bug: #1653880
    Change-Id: I361caaf7f70580ee8c7b48a4a9c9477bdefd8b4b

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/mitaka)

Reviewed: https://review.openstack.org/416524
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=67e334b81c4038f2cf210e1410b774f9b19fe10e
Submitter: Jenkins
Branch: stable/mitaka

commit 67e334b81c4038f2cf210e1410b774f9b19fe10e
Author: Kevin Benton <email address hidden>
Date: Tue Jan 3 18:10:36 2017 -0800

    Reduce IP link show calls for SR-IOV scan loop

    The device scanning logic was calling 'ip link show' for every
    vf_index on the system, which was taking an excessive amount of
    time an CPU cycles on very dense SR-IOV servers (>64 interfaces).
    This was being executed every 2 seconds so it would cause the
    agent to take a large percentage of the CPU time.

    This patch adjusts the logic to use two 'ip link show' commands for
    checking all of the operations in a single get_assigned_devices_info
    call.

    Conflicts:
      neutron/tests/unit/plugins/ml2/drivers/mech_sriov/agent/test_eswitch_manager.py

    Closes-Bug: #1653880
    Change-Id: I361caaf7f70580ee8c7b48a4a9c9477bdefd8b4b
    (cherry picked from commit 9a022e7d7b85b7c21cf26698fe59c818c4577194)

tags: added: in-stable-mitaka
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (stable/newton)

Reviewed: https://review.openstack.org/416523
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=8f98999b8a13bafd78962262b3c51332f3ee50c8
Submitter: Jenkins
Branch: stable/newton

commit 8f98999b8a13bafd78962262b3c51332f3ee50c8
Author: Kevin Benton <email address hidden>
Date: Tue Jan 3 18:10:36 2017 -0800

    Reduce IP link show calls for SR-IOV scan loop

    The device scanning logic was calling 'ip link show' for every
    vf_index on the system, which was taking an excessive amount of
    time an CPU cycles on very dense SR-IOV servers (>64 interfaces).
    This was being executed every 2 seconds so it would cause the
    agent to take a large percentage of the CPU time.

    This patch adjusts the logic to use two 'ip link show' commands for
    checking all of the operations in a single get_assigned_devices_info
    call.

    Conflicts:
      neutron/tests/unit/plugins/ml2/drivers/mech_sriov/agent/test_eswitch_manager.py

    Closes-Bug: #1653880
    Change-Id: I361caaf7f70580ee8c7b48a4a9c9477bdefd8b4b
    (cherry picked from commit 9a022e7d7b85b7c21cf26698fe59c818c4577194)

tags: added: in-stable-newton
tags: added: neutron-proactive-backport-potential
tags: removed: neutron-proactive-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 10.0.0.0b3

This issue was fixed in the openstack/neutron 10.0.0.0b3 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 9.2.0

This issue was fixed in the openstack/neutron 9.2.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 8.4.0

This issue was fixed in the openstack/neutron 8.4.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.