]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common/RWLock: allow disabling read/write lock counts
authorPiotr Dałek <piotr.dalek@ts.fujitsu.com>
Wed, 17 Jun 2015 13:43:24 +0000 (15:43 +0200)
committerPiotr Dałek <piotr.dalek@ts.fujitsu.com>
Wed, 17 Jun 2015 13:43:24 +0000 (15:43 +0200)
commit8feb27d821c76d00f76064fa04559e493be7ac32
treedf58f89434a1fc71432e5eb751b0f71d67253d76
parent6af50f41052bc49efc2cdb18aae01075a8c652cf
common/RWLock: allow disabling read/write lock counts

For some workloads, it is worthwile to disable adjusting of internal nrlock
and nwlock atomic variables (which isn't super cheap and may lock CPUs for
longer than with regular mutexes). Added new argument (track_locks) to
RWLock constuctor (with default value of True) which enables or disables
adjusting these variables if needed.
(R|W)Locker helper classes are around 40% faster when tracking is disabled
and direct get_read()/get_write()+unlock() methods are up to 120% faster
when tracking is disabled.

Signed-off-by: Piotr Dałek <piotr.dalek@ts.fujitsu.com>
src/common/RWLock.h