[ovs-dev] [PATCH v4 1/1] ovs-thread: Fix thread id for threads not started with ovs_thread_create()

Stokes, Ian ian.stokes at intel.com
Fri Jun 8 14:56:06 UTC 2018


> On 04.06.2018 11:07, Eelco Chaudron wrote:
> > When ping-pong'in a live VM migration between two machines running
> > OVS-DPDK every now and then the ping misses would increase
> > dramatically. For example:
> >
> > ===========Stream Rate: 3Mpps=========== No Stream_Rate Downtime
> > Totaltime Ping_Loss Moongen_Loss
> >  0       3Mpps      128     13974       115      7168374
> >  1       3Mpps      145     13620        17      1169770
> >  2       3Mpps      140     14499       116      7141175
> >  3       3Mpps      142     13358        16      1150606
> >  4       3Mpps      136     14004        16      1124020
> >  5       3Mpps      139     15494       214     13170452
> >  6       3Mpps      136     15610       217     13282413
> >  7       3Mpps      146     13194        17      1167512
> >  8       3Mpps      148     12871        16      1162655
> >  9       3Mpps      137     15615       214     13170656
> >
> > I identified this issue being introduced in OVS commit,
> > f3e7ec254738 ("Update relevant artifacts to add support for DPDK
> > 17.05.1.") and more specific due to DPDK commit,
> > af1475918124 ("vhost: introduce API to start a specific driver").
> >
> > The combined changes no longer have OVS start the vhost socket polling
> > thread at startup, but DPDK will do it on its own when the first vhost
> > client is started.
> >
> > Figuring out the reason why this happens kept me puzzled for quite some
> time...
> > What happens is that the callbacks called from the vhost thread are
> > calling ovsrcu_synchronize() as part of destroy_device(). This will
> > end-up calling seq_wait__().
> >
> > By default, all created threads outside of OVS will get thread id 0,
> > which is equal to the main ovs thread. So for example in the
> > seq_wait__() function above if the main thread is waiting already we
> > won't add ourselves as a waiter.
> >
> > The fix below assigns OVSTHREAD_ID_UNSET to none OVS created threads,
> > which will get updated to a valid ID on the first call to
> > ovsthread_id_self().
> >
> > Signed-off-by: Eelco Chaudron <echaudro at redhat.com>
> 
> 
> Fixes: f3e7ec254738 ("Update relevant artifacts to add support for DPDK
> 17.05.1.")
> Acked-by: Ilya Maximets <i.maximets at samsung.com>

Thanks for this, I've applied to DPDK_MERGE and will backport to 2.9 and 2.8.

Ian


More information about the dev mailing list