[dpdk-dev] [RFC] ethdev: make rte flow API thread safe
Thomas Monjalon
thomas at monjalon.net
Tue Sep 8 17:03:53 CEST 2020
08/09/2020 16:52, Stephen Hemminger:
> On Mon, 7 Sep 2020 02:36:48 +0000
> Suanming Mou <suanmingm at nvidia.com> wrote:
> > > What is the performance impact of this for currently working applications that
> > > use a single thread to program flow rules. You are adding a couple of system
> > > calls to what was formerly a totally usermode operation.
>
> Read the source for glibc and see what pthread_mutex does
What would be the best lock for rte_flow?
We have spin lock, ticket lock, MCS lock (and rwlock) in DPDK.
> > If I understand correctly, in the non-contended single thread case, pthread mutex lock should not go to the kernel space.
> > I also wrote a small application with pthread mutex, and strace shows no system call was introduced.
> >
> > Another simple testing code below is to check the cycles cost difference in every round between pthread mutex and spin_lock.
>
> Micro benchmarks of locking is hard to see.
More information about the dev
mailing list