[lttng-dev] [PATCH] [URCU] Allow forcing the use of sys membarrier

Duncan Sands duncan.sands at deepbluecap.com
Tue Sep 6 13:07:10 UTC 2016


When using the RCU_MEMBARRIER flavour of userspace-RCU, kernel support for 
sys-membarrier is detected dynamically and stored in the rcu_has_sys_membarrier 
global variable.  Checking the value of this variable adds a small but 
measurable overhead to smp_mb_slave.  I only use userspace-rcu on systems which 
support sys-membarrier, and I'd like a way of avoiding that overhead.

The attached patch makes the following changes: if RCU_FORCE_SYS_MEMBARRIER is 
defined then rcu_has_sys_membarrier is 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 and if it isn't supported then the program aborts.

I didn't try to integrate this feature into the build system (eg by adding a 
configure option for it) since I'm using my own build system.

Best wishes, Duncan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: force-sys-membarrier.diff
Type: text/x-patch
Size: 1544 bytes
Desc: not available
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20160906/3864b6f5/attachment.bin>


More information about the lttng-dev mailing list