[ovs-dev] [PATCH] coverage: Add coverage_try_clear() for performance-critical threads.

Alex Wang alexw at nicira.com
Sat Aug 22 15:44:14 UTC 2015


Sorry for the delay of pushing this and related dpdk patches,

Want to spend some time next week measuring the performance impact,~

Thanks,
Alex Wang,

On Fri, Aug 21, 2015 at 12:48 PM, Ben Pfaff <blp at nicira.com> wrote:

> On Thu, Aug 13, 2015 at 11:48:49AM -0700, Alex Wang wrote:
> > For performance-critical threads like pmd threads, we currently make them
> > never call coverage_clear() to avoid contention over the global mutex
> > 'coverage_mutex'.  So, even though pmd thread still keeps updating their
> > thread-local coverage count, the count is never attributed to the global
> > total.  But it is useful to have them available.
> >
> > This commit makes this happen by implementing a non-contending version
> > of the clear function, coverage_try_clear().  The function will use
> > the ovs_mutex_trylock() and return immediately if the mutex cannot
> > be acquired.  Since threads like pmd thread are always busy-looping,
> > the lock will eventually be acquired.
> >
> > Requested-by: Ilya Maximets <i.maximets at samsung.com>
> > Signed-off-by: Alex Wang <alexw at nicira.com>
>
> This seems like an improvement.  I can imagine better data structures
> but I don't know whether they're worthwhile.
>
> Acked-by: Ben Pfaff <blp at nicira.com>
>



More information about the dev mailing list