[ovs-git] [openvswitch/ovs] fbe096: coverage: Add coverage_try_clear() for performance...

GitHub noreply at github.com
Tue Aug 25 23:22:20 UTC 2015


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: fbe0962b28808a24fc2bff8b5d17cb0c46756c59
      https://github.com/openvswitch/ovs/commit/fbe0962b28808a24fc2bff8b5d17cb0c46756c59
  Author: Alex Wang <alexw at nicira.com>
  Date:   2015-08-25 (Tue, 25 Aug 2015)

  Changed paths:
    M lib/coverage.c
    M lib/coverage.h
    M lib/dpif-netdev.c

  Log Message:
  -----------
  coverage: Add coverage_try_clear() for performance-critical threads.

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>
Acked-by: Ilya Maximets <i.maximets at samsung.com>
Acked-by: Ben Pfaff <blp at nicira.com>
Acked-by: Daniele Di Proietto <diproiettod at vmware.com




More information about the git mailing list