> The pinctrl would go to sleep if the lock wasn't available without
> checking if there is any other update. However, we still might be
> able to process packets without the lock (some packet processing
> still requires a lock). This improves the pinctrl throughput a bit.
>
> Fixes: d71c45199341 ("pinctrl: Use ovs_mutex_trylock() in the pinctrl
> thread.")
> Signed-off-by: Ales Musil <[email protected]>
Acked-by: Lorenzo Bianconi <[email protected]>
Just for my curiosity, do you have any numbers to check the improvement?
Regards,
Lorenzo
> ---
> controller/pinctrl.c | 33 ++++++++++++++++-----------------
> 1 file changed, 16 insertions(+), 17 deletions(-)
>
> diff --git a/controller/pinctrl.c b/controller/pinctrl.c
> index 775d37601..35c42942f 100644
> --- a/controller/pinctrl.c
> +++ b/controller/pinctrl.c
> @@ -4026,26 +4026,25 @@ pinctrl_handler(void *arg_)
> }
>
> if (lock_failed) {
> - /* Wait for 5 msecs before waking to avoid degrading the
> - * lock to a spinlock. */
> + /* Wait for 5 msecs before waking in case there isn't anything
> + * else to process. */
> poll_timer_wait(5);
> - } else {
> - rconn_run_wait(swconn);
> - rconn_recv_wait(swconn);
> - if (rconn_is_connected(swconn)) {
> - send_garp_rarp_wait(send_garp_rarp_time);
> - send_arp_nd_wait(send_arp_nd_time);
> - ipv6_ra_wait(send_ipv6_ra_time);
> - ip_mcast_querier_wait(send_mcast_query_time);
> - svc_monitors_wait(svc_monitors_next_run_time);
> - ipv6_prefixd_wait(send_prefixd_time);
> - bfd_monitor_wait(bfd_time);
> - }
> - seq_wait(pinctrl_handler_seq, new_seq);
> -
> - latch_wait(&pctrl->pinctrl_thread_exit);
> }
>
> + rconn_run_wait(swconn);
> + rconn_recv_wait(swconn);
> + if (rconn_is_connected(swconn)) {
> + send_garp_rarp_wait(send_garp_rarp_time);
> + send_arp_nd_wait(send_arp_nd_time);
> + ipv6_ra_wait(send_ipv6_ra_time);
> + ip_mcast_querier_wait(send_mcast_query_time);
> + svc_monitors_wait(svc_monitors_next_run_time);
> + ipv6_prefixd_wait(send_prefixd_time);
> + bfd_monitor_wait(bfd_time);
> + }
> + seq_wait(pinctrl_handler_seq, new_seq);
> + latch_wait(&pctrl->pinctrl_thread_exit);
> +
> ovsrcu_quiesce_start();
> poll_block();
> }
> --
> 2.53.0
>
> _______________________________________________
> dev mailing list
> [email protected]
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev