On 4/12/21 5:20 PM, Gaetan Rivet wrote: > |The dataplane threads (PMDs) send offloading commands to a dedicated > offload management thread. The current implementation uses a lock and > benchmarks show a high contention on the queue in some cases. With > high-contention, the mutex will more often lead to the locking thread > yielding in wait, using a syscall. This should be avoided in a userland > dataplane. The mpsc-queue can be used instead. It uses less cycles and > has lower latency. Benchmarks show better behavior as multiple > revalidators and one or multiple PMDs writes to a single queue while > another thread polls it. One trade-off with the new scheme however is to > be forced to poll the queue from the offload thread. Without mutex, a > cond_wait cannot be used for signaling. The offload thread is > implementing an exponential backoff and will sleep in short increments > when no data is available. This makes the thread yield, at the price of > some latency to manage offloads after an inactivity period. > Signed-off-by: Gaetan Rivet <[email protected]> Reviewed-by: Eli Britstein > <[email protected]> --- lib/dpif-netdev.c | 109 > ++++++++++++++++++++++++---------------------- 1 file changed, 57 > insertions(+), 52 deletions(-)| With the ovsrcu_quiesce()/next_rcu change discussed in patch 14: Reviewed-by: Maxime Coquelin <[email protected]> Thanks, Maxime _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
- Re: [ovs-dev] [PATCH v2 15/28] dpif-netdev: Postpone ... Maxime Coquelin
- [ovs-dev] [PATCH v2 23/28] netdev-offload-dpdk: Protect co... Gaetan Rivet
- Re: [ovs-dev] [PATCH v2 23/28] netdev-offload-dpdk: P... Maxime Coquelin
- [ovs-dev] [PATCH v2 08/28] dpif-netdev: Implement hardware... Gaetan Rivet
- Re: [ovs-dev] [PATCH v2 08/28] dpif-netdev: Implement... Maxime Coquelin
- [ovs-dev] [PATCH v2 13/28] netdev-offload: Add multi-threa... Gaetan Rivet
- Re: [ovs-dev] [PATCH v2 13/28] netdev-offload: Add mu... Maxime Coquelin
- [ovs-dev] [PATCH v2 17/28] dpif-netdev: Introduce tagged u... Gaetan Rivet
- Re: [ovs-dev] [PATCH v2 17/28] dpif-netdev: Introduce... Maxime Coquelin
- [ovs-dev] [PATCH v2 24/28] dpif-netdev: Use lockless queue... Gaetan Rivet
- Re: [ovs-dev] [PATCH v2 24/28] dpif-netdev: Use lockl... Maxime Coquelin
- [ovs-dev] [PATCH v2 22/28] netdev-offload-dpdk: Lock rte_f... Gaetan Rivet
- Re: [ovs-dev] [PATCH v2 22/28] netdev-offload-dpdk: L... Maxime Coquelin
- [ovs-dev] [PATCH v2 25/28] dpif-netdev: Make megaflow and ... Gaetan Rivet
- Re: [ovs-dev] [PATCH v2 25/28] dpif-netdev: Make mega... Maxime Coquelin
- [ovs-dev] [PATCH v2 11/28] llring: Add lockless MPMC bound... Gaetan Rivet
- Re: [ovs-dev] [PATCH v2 11/28] llring: Add lockless M... Maxime Coquelin
- [ovs-dev] [PATCH v2 16/28] dpif-netdev: Use seq-pool for m... Gaetan Rivet
- Re: [ovs-dev] [PATCH v2 16/28] dpif-netdev: Use seq-p... Maxime Coquelin
- [ovs-dev] [PATCH v2 10/28] mpsc-queue: Module for lock-fre... Gaetan Rivet
- Re: [ovs-dev] [PATCH v2 10/28] mpsc-queue: Module for... Maxime Coquelin
