From: Mathieu Desnoyers Date: Fri, 11 Sep 2015 14:33:43 +0000 (-0400) Subject: Fix: dynamic fallback to compat futex on sys_futex ENOSYS X-Git-Tag: v0.9.0~39 X-Git-Url: http://git.lttng.org/?a=commitdiff_plain;h=42dfe454abcd206bb2005261c6b79cb3d4f9ce29;hp=42dfe454abcd206bb2005261c6b79cb3d4f9ce29;p=userspace-rcu.git 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 Acked-by: Paul E. McKenney CC: Michael Jeanson CC: Jon Bernard ---