Skip to content

Lacp member down after waiting for urcu2 to quiesce. #345

Open

Description

@danieldin95

OpenvSwitch version

[root@node-2 ~]# ovs-vsctl show | grep ovs_v
    ovs_version: "2.16.2"
[root@node-2 ~]#

We add enp4s0f0np0 and enp2s0f0np0 as lacp bond with fast mode. When ucru thread occured unreasonably long time poll interval, the main thread will be blocked exceed 2000ms, and the member of lacp bond has link state down.

2024-10-08 19:16:16.577 +0800 ¦ node-46 ¦ openvswitch ¦  ¦ 2024-10-08T11:16:16.577Z|29081266|ovs_rcu|WARN|blocked 1000 ms waiting for urcu2 to quiesce
2024-10-08 19:16:17.577 +0800 ¦ node-46 ¦ openvswitch ¦  ¦ 2024-10-08T11:16:17.577Z|29081267|ovs_rcu|WARN|blocked 2000 ms waiting for urcu2 to quiesce
2024-10-08 19:16:17.858 +0800 ¦ node-46 ¦ openvswitch ¦  ¦ 2024-10-08T11:16:17.858Z|03663|timeval(urcu2)|WARN|Unreasonably long 2306ms poll interval (2285ms user, 0ms system)
2024-10-08 19:16:17.858 +0800 ¦ node-46 ¦ openvswitch ¦  ¦ 2024-10-08T11:16:17.858Z|03664|timeval(urcu2)|WARN|faults: 1 minor, 0 major
2024-10-08 19:16:17.858 +0800 ¦ node-46 ¦ openvswitch ¦  ¦ 2024-10-08T11:16:17.858Z|03665|timeval(urcu2)|WARN|context switches: 3225 voluntary, 39 involuntary
2024-10-08 19:16:17.858 +0800 ¦ node-46 ¦ openvswitch ¦  ¦ 2024-10-08T11:16:17.858Z|03666|poll_loop(urcu2)|INFO|Dropped 57443 log messages in last 9 seconds (most recently, 5 seconds ago) due to excessive rate
2024-10-08 19:16:17.858 +0800 ¦ node-46 ¦ openvswitch ¦  ¦ 2024-10-08T11:16:17.858Z|03667|poll_loop(urcu2)|INFO|wakeup due to 0-ms timeout at lib/ovs-rcu.c:236 (67% CPU usage)
2024-10-08 19:16:17.867 +0800 ¦ node-46 ¦ openvswitch ¦  ¦ 2024-10-08T11:16:17.867Z|29081268|bond|INFO|member enp4s0f0np0: link state down
2024-10-08 19:16:17.867 +0800 ¦ node-46 ¦ openvswitch ¦  ¦ 2024-10-08T11:16:17.867Z|29081269|bond|INFO|member enp4s0f0np0: disabled
2024-10-08 19:16:17.964 +0800 ¦ node-46 ¦ openvswitch ¦  ¦ 2024-10-08T11:16:17.964Z|29081270|bond|INFO|member enp4s0f0np0: link state up
2024-10-08 19:16:17.964 +0800 ¦ node-46 ¦ openvswitch ¦  ¦ 2024-10-08T11:16:17.964Z|29081271|bond|INFO|member enp4s0f0np0: enabled

Activity

  1. chaudron commented on Oct 14, 2024

    @chaudron
  2. danieldin95 commented on Oct 18, 2024

    @danieldin95
    Author

    Thank you @chaudron. But I cann't understand why lacp hasn't beed moved to monitor thread or single thread. In main thread to send the lacp packet is dangerous, we don't know what causes the man thread to get blocked.

  3. danieldin95 commented on Oct 23, 2024

    @danieldin95
    Author

    Hi @chaudron , the long time blocking can recover on its own.

  4. chaudron commented on Oct 23, 2024

    @chaudron

    If your system is overloaded the blocking will recover on its own. If for some reason the locking continues it's probably a bug. It could also be that there is a lot of rcu backlog work, but spending 2+ seconds doing this sounds like a lot.

  5. danieldin95 commented on Oct 23, 2024

    @danieldin95
    Author

    Yes @chaudron. But this issue arises in our production environment, and we used ovn for openstack network. In order to be able to carry larger network traffic from tenant network to external network, we enable ovs-dpdk support for gateway node(also network node). Although dpdk improves the throughput of elephant streams and the forwarding latency of a single packet, once a large number (~20W) of small streams (pps < 5) are generated instantly, it still puts considerable load pressure on the revalidator threads, causing the ovs-rcu to spend a lot of time dealing with callback.

  6. chaudron commented on Oct 23, 2024

    @chaudron

    How many datapath flows do you have in this scenario, and how busy are the revalidators(ovs-appctl upcall/show)? Are you sure enough CPU resources are available for OVS?

  7. danieldin95 commented on Oct 23, 2024

    @danieldin95
    Author

    The datapath has ~20W flows, and vswitch has ~50W openflows.

    [root@node-10 ~]# ovs-ofctl dump-flows br-int | wc
     559508 5030055 128885820
    [root@node-10 ~]# ovs-appctl upcall/show | grep flows
      flows         : (current 260044) (avg 260037) (max 704399) (limit 382736)
    
  8. chaudron commented on Oct 23, 2024

    @chaudron

    Does not look too much, what is your dump duration, it was cut off in your output.

  9. danieldin95 commented on Oct 23, 2024

    @danieldin95
    Author

    The dump duration is about ~2000ms, but this is not root cause of lacp link down. Revalidator will exit non-quiesce in each dump batch(50 flows). Would it be more reasonable to implement the sending of lacp messages in a single thread?

  10. chaudron commented on Oct 23, 2024

    @chaudron

    Is the ~2000ms the output of the upcall output? Or are you basing this off the log messages? 2000ms for the dump duration sounds way too long to me. You might want to figure out why this is. Do you have some kind of rte offloading that takes time (assuming this is dpdk datapath)? Also, I think you should investigate why the urcu2 thread gets stalled, as callbacks should be quick.

  11. danieldin95 commented on Oct 24, 2024

    @danieldin95
    Author

    Yes, we also seen Unreasonable long time in the log. And we want to know how long the callback took, after applying the following patch, it show ~1500ms.

        long long int start = time_msec();
    
        LIST_FOR_EACH_POP (cbset, list_node, &cbsets) {
            struct ovsrcu_cb *cb;
    
            for (cb = cbset->cbs; cb < &cbset->cbs[cbset->n_cbs]; cb++) {
                cb->function(cb->aux);
                call ++;
            }
            free(cbset->cbs);
            free(cbset);
        }
    
        elapsed = time_msec() - start;
        if (elapsed >= 100) {
            VLOG_WARN("call %d free guarded list with %u ms.", call, elapsed);
        }
    

    So suspected that many OpenFlow rules are associated in a ukey and released the atomic reference count of the rules, which consumed a lot of time cumulatively.

  12. chaudron commented on Oct 24, 2024

    @chaudron

    It would be nice to know exactly what function is causing this so you can further analyze what is taking 1.5 seconds, which seems way too long. You could attach a perf probe to your new function. Locate it with perf probe -x /usr/sbin/ovs-vswitchd -L ovsrcu_call_postponed@ovs-rcu.c and then record it with -g --call-graph dwarf so you can see the call graph.

  13. danieldin95 commented on Oct 24, 2024

    @danieldin95
    Author

    Thanks @chaudron, Do you have any suggestions for implementing lacp in a single thread like monitor thread? or What suggestions does the community have? To avoid the main thread getting blocking and affecting the sending of lacp packets?

  14. chaudron commented on Oct 24, 2024

    @chaudron

    Your problem is that the RCU thread is being blocked, not the main thread. Is the main thread blocked waiting on this synchronization? Anyway, I think it's better to find the root cause of the delay and fix this, instead of working around the real issue.

  15. danieldin95 commented on Oct 24, 2024

    @danieldin95
    Author

    I understand your point of view, and I will continue to investigate the issue of RCU blocked. But if it is ~55w openflow rules, it also takes a lot of time for dumping all flow rules via ovs-ofctl, and query openflow rules message is also in the main thread.

    2024-10-24T10:04:36.859Z|16210|timeval|WARN|Unreasonably long 2085ms poll interval (2079ms user, 0ms system)
    2024-10-24T10:04:36.860Z|16211|timeval|WARN|faults: 4444 minor, 0 major
    2024-10-24T10:04:36.860Z|16212|timeval|WARN|context switches: 72 voluntary, 9 involuntary
    2024-10-24T10:04:36.860Z|16213|coverage|INFO|Skipping details of duplicate event coverage for hash=843564ad
    2024-10-24T10:04:36.860Z|16214|poll_loop|INFO|Dropped 150 log messages in last 167 seconds (most recently, 164 seconds ago) due to excessive rate
    2024-10-24T10:04:36.860Z|16215|poll_loop|INFO|wakeup due to [POLLIN] on fd 950 (/var/run/openvswitch/br-Bond1.mgmt<->) at lib/stream-fd.c:274 (51% CPU usage)
    2024-10-24T10:04:36.863Z|16216|poll_loop|INFO|wakeup due to [POLLOUT] on fd 985 (/var/run/openvswitch/br-Bond1.mgmt<->) at lib/stream-fd.c:153 (51% CPU usage)
    2024-10-24T10:04:36.867Z|16217|poll_loop|INFO|wakeup due to [POLLIN] on fd 950 (/var/run/openvswitch/br-Bond1.mgmt<->) at lib/stream-fd.c:274 (51% CPU usage)
    2024-10-24T10:04:36.871Z|16218|poll_loop|INFO|wakeup due to [POLLOUT] on fd 987 (/var/run/openvswitch/br-Bond1.mgmt<->) at lib/stream-fd.c:153 (51% CPU usage)
    2024-10-24T10:04:36.874Z|16219|poll_loop|INFO|wakeup due to [POLLIN] on fd 987 (/var/run/openvswitch/br-Bond1.mgmt<->) at lib/stream-fd.c:157 (51% CPU usage)
    

    This means that every time we try to dump openflow rules, it will affect the lacp packet transmission. I don't think it's a good implementation.

  16. chaudron commented on Oct 24, 2024

    @chaudron

    I have a system here with 200k datapath flows, and dumping takes around 150ms, with peaks to <500ms when revalidating flows. Dumping (open)flows might take time, but the system/main thread is not blocked during this dump.

  17. danieldin95 commented on Oct 25, 2024

    @danieldin95
    Author

    Thank you @chaudron for your reply, can you show me for your cpu info. the following is mine.

    Architecture:        aarch64
    CPU(s):              96
    NUMA node(s):        4
    Model:               0
    Model name:          Kunpeng-920
    CPU max MHz:         2600.0000
    CPU min MHz:         200.0000
    NUMA node0 CPU(s):   0-23
    NUMA node1 CPU(s):   24-47
    NUMA node2 CPU(s):   48-71
    NUMA node3 CPU(s):   72-95
    
  18. chaudron commented on Oct 25, 2024

    @chaudron

    I have an Intel system:

    $ lscpu
    Architecture:            x86_64
      CPU op-mode(s):        32-bit, 64-bit
      Address sizes:         46 bits physical, 57 bits virtual
      Byte Order:            Little Endian
    CPU(s):                  64
      On-line CPU(s) list:   0-63
    Vendor ID:               GenuineIntel
      BIOS Vendor ID:        Intel
      Model name:            Intel(R) Xeon(R) Gold 6326 CPU @ 2.90GHz
        BIOS Model name:     Intel(R) Xeon(R) Gold 6326 CPU @ 2.90GHz
        CPU family:          6
        Model:               106
        Thread(s) per core:  2
        Core(s) per socket:  16
        Socket(s):           2
        Stepping:            6
    ...
    NUMA:                    
      NUMA node(s):          2
      NUMA node0 CPU(s):     0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62
      NUMA node1 CPU(s):     1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63
    
  19. danieldin95 commented on Nov 6, 2024

    @danieldin95
    Author

    Thank you @chaudron for your reply. I'm very sorry for taking so long to reply to you. I have learned about the implementation of lacp in the kernel, as well as dpdk. In the kernel Use work queues to update the lacp state machine and send lacp messages. And In the DPDK also queue the lacp message in a tx-ring of the network port during the timer task, waiting for the DPDK application to call the rte_eth_tx_burst api to empty the lacp buffer queue. So is it possible for the OVS community to implement the sending of lacp messages in a timer task? This design is more conducive for lacp in production environments.

  20. chaudron commented on Nov 6, 2024

    @chaudron

    It doesn’t look like anyone is currently working on this upstream, likely because no one has encountered any issues with it yet. Once your root cause is resolved, you might find that it’s no longer necessary. You could start a discussion on the OVS discuss mailing list to see if others have run into this issue as well.

  21. danieldin95 commented on Dec 4, 2025

    @danieldin95
    Author

    Hi @chaudron

    I meet that main thread blocking 2s again when the netdev datapath has ~300W conntracks.

    11:02:10  netdev     9972880    5          0          cur:201 limit:200000     3        total:3302007 tcp:1 udp:3302006
    11:02:14  netdev     10115301   2          0          cur:206 limit:200000     3        total:3340226 tcp:1 udp:3340225
    11:02:18  netdev     6750452    3          0          cur:213 limit:200000     3        total:3320685 tcp:1 udp:3320684
    11:02:22  netdev     4903975    3          0          cur:209 limit:200000     3        total:3261693 tcp:1 udp:3261692
    11:02:26  netdev     4290983    1          0          cur:204 limit:200000     3        total:3248596 tcp:1 udp:3248595
    
    2025-12-04T03:00:06.978Z|05431|ovs_rcu(urcu2)|WARN|blocked 2000 ms waiting for main to quiesce
    2025-12-04T03:00:10.700Z|05432|ovs_rcu(urcu2)|WARN|blocked 1000 ms waiting for main to quiesce
    2025-12-04T03:00:11.700Z|05433|ovs_rcu(urcu2)|WARN|blocked 2000 ms waiting for main to quiesce
    2025-12-04T03:00:15.064Z|05434|ovs_rcu(urcu2)|WARN|blocked 1000 ms waiting for main to quiesce
    2025-12-04T03:00:16.064Z|05435|ovs_rcu(urcu2)|WARN|blocked 2000 ms waiting for main to quiesce
    2025-12-04T03:00:19.704Z|05436|ovs_rcu(urcu2)|WARN|blocked 1000 ms waiting for main to quiesce
    2025-12-04T03:00:23.400Z|05437|ovs_rcu(urcu2)|WARN|blocked 1001 ms waiting for main to quiesce
    2025-12-04T03:00:27.406Z|05438|ovs_rcu(urcu2)|WARN|blocked 1000 ms waiting for main to quiesce
    2025-12-04T03:00:31.008Z|05439|ovs_rcu(urcu2)|WARN|blocked 1000 ms waiting for main to quiesce
    

    The community recently considered fixing this issues?

  22. chaudron commented on Dec 4, 2025

    @chaudron
  23. danieldin95 commented on Dec 5, 2025

    @danieldin95
    Author

    When I dump conntracks for netdev, the main thread has blocking 2s. @chaudron

    $ ovs-appctl dpctl/ct-stats-show netdev@ovs-netdev
    Connections Stats:
        Total: 4904902
      TCP: 1
      UDP: 4904901
    $
    

    As I known, ovs-appctl commands is accepted by the main thread, and dumping a mount of conntracks will take long time on the main thread.

  24. chaudron commented on Dec 5, 2025

    @chaudron

    I guess this could be optimized, but I'm not aware of anyone working on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions