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

Daniele Di Proietto diproiettod at vmware.com
Mon Aug 24 18:07:58 UTC 2015

Hi Alex,

sorry for the delay and thanks for taking care of this.
I couldn't experience any noticeable performance drop.

Acked-by: Daniele Di Proietto <diproiettod at vmware.com>

On 22/08/2015 16:44, "Alex Wang" <alexw at nicira.com> wrote:

>Sorry for the delay of pushing this and related dpdk patches,
>Want to spend some time next week measuring the performance impact,~
>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
>> > never call coverage_clear() to avoid contention over the global mutex
>> > 'coverage_mutex'.  So, even though pmd thread still keeps updating
>> > thread-local coverage count, the count is never attributed to the
>> > 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>
>dev mailing list
>dev at openvswitch.org

More information about the dev mailing list