Fix: dynamic fallback to compat futex on sys_futex ENOSYS
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 11 Sep 2015 14:33:43 +0000 (10:33 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 13 Sep 2015 16:38:17 +0000 (12:38 -0400)
commitf54e7d5ef5e33c02c8137902e49171ea0626e1bc
tree66463ba9ca00f5889f6e6fb335de236b8ffdce28
parentd60e878d183c50b728b2f190d90d824863289f47
Fix: dynamic fallback to compat futex on sys_futex ENOSYS

Some MIPS processors (e.g. Cavium Octeon II) dynamically check if the
CPU supports ll/sc within sys_futex, and return a ENOSYS errno if they
don't, even though the architecture implements sys_futex.

Handle this situation by always building the sys_futex compatibility
layer, and fall-back on it if sys_futex return a ENOSYS errno. This is
a tiny compat layer which adds very little space overhead.

This adds an unlikely branch on return from sys_futex, which should
not be an issue performance-wise (we've already taken a system call).

Since this is a fall-back mode, don't try to be clever, and don't cache
the result, so that the common cases (architectures with a properly
working sys_futex) don't get two conditional branches, just one.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
CC: Michael Jeanson <mjeanson@efficios.com>
CC: Jon Bernard <jbernard@debian.org>
Makefile.am
urcu/futex.h
This page took 0.025543 seconds and 4 git commands to generate.