Allow forcing the use of sys membarrier
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 16 Sep 2016 19:15:41 +0000 (15:15 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 16 Sep 2016 19:56:28 +0000 (15:56 -0400)
commitd8d9a3405ce46af6d34d2e80e260ad50f3d211a0
tree24d812a9a1e157e7304ac2878c540fc44f26d0d4
parent0b9c513b2513c37e3ed0a5ee047b8d40eef482ab
Allow forcing the use of sys membarrier

When using the default (liburcu.so) and bulletproof (liburcu-bp.so)
flavours of Userspace RCU, kernel support for sys-membarrier is detected
dynamically and stored in the rcu_has_sys_membarrier_memb and
urcu_bp_has_sys_membarrier global variables.

Checking the value of these variables adds a small but measurable overhead
to smp_mb_slave. On systems which support sys-membarrier, it would be
nice to have a way of avoiding that overhead.

Here is the proposed approach: if CONFIG_RCU_FORCE_SYS_MEMBARRIER is
defined then rcu_has_sys_membarrier_memb/urcu_bp_has_sys_membarrier are
replaced with the constant 1, eliminating the overhead in smp_mb_slave.
As a sanity check, support for sys-membarrier is still detected at
startup. A program using liburcu or liburcu-bp compiled with this option
aborts in the library constructor if the membarrier system call is not
supported by the operating system.

Suggested-by: Duncan Sands <duncan.sands@deepbluecap.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
README.md
configure.ac
include/urcu/map/urcu.h
include/urcu/static/urcu-bp.h
include/urcu/static/urcu.h
src/urcu-bp.c
src/urcu.c
This page took 0.038839 seconds and 4 git commands to generate.