From: Mathieu Desnoyers Date: Fri, 16 Sep 2016 19:15:41 +0000 (-0400) Subject: Allow forcing the use of sys membarrier X-Git-Tag: v0.10.0~18 X-Git-Url: http://git.lttng.org./?a=commitdiff_plain;h=d8d9a3405ce46af6d34d2e80e260ad50f3d211a0;hp=d8d9a3405ce46af6d34d2e80e260ad50f3d211a0;p=userspace-rcu.git 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 Signed-off-by: Mathieu Desnoyers ---