forked from openvswitch/ovs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Signed-off-by: Alex Wang <[email protected]> Acked-by: Ilya Maximets <[email protected]> Acked-by: Ben Pfaff <[email protected]> Acked-by: Daniele Di Proietto <[email protected]
- Loading branch information
Showing
3 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters