Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OVN: Fix the ovn-controller 100% usage issue with put_mac_bindings
ISSUE: a. As soon as entries get added to put_mac_bindings in pinctrl.c, ovn-controller CPU consumption reached 100%. b. This happens because in wait_put_mac_bindings, if !hmap_is_empty(&put_mac_bindings) succeeds and calls poll_immediat_wake(). ovn-controller.log: "2019-05-10T19:43:28.035Z|00035|poll_loop|INFO|wakeup due to 0-ms timeout at ovn/controller/pinctrl.c:2520 (99% CPU usage)" ROOT_CAUSE: a. Earlier it used to work fine, because in run_put_mac_bindings all the bindings in put_mac_bindings would be flushed. b. As a part of adding a new thread in pinctrl, this line got replaced with calling buffer_put_mac_bindings. " . . . /* Move the mac bindings from 'put_mac_bindings' hmap to * 'buffered_mac_bindings' and notify the pinctrl_handler. * pinctrl_handler will reinject the buffered packets. */ if (!hmap_is_empty(&put_mac_bindings)) { buffer_put_mac_bindings(); notify_pinctrl_handler(); } " And buffer_put_mac_binding would pop the bindings from put_mac_bindings, thereby emptying it. c. However, 1c24b2f changed the buffer dequeueing logic and in the process removed buffer_put_mac_binding, as a result put_mac_bindings would never get empty. FIX: a. Added call to flush_put_mac_bindings back in run_put_mac_bindings. b. Additionally, updated the documentation in pinctrl.c to reflect the new buffer dequeueing logic added by 1c24b2f. Reported-by: Ankur Sharma <[email protected]> CC: Lorenzo Bianconi <[email protected]> Fixes: 1c24b2f ("OVN: fix pinctrl ip buffering for gw router port") Signed-off-by: Ankur Sharma <[email protected]> Signed-off-by: Ben Pfaff <[email protected]>