locking: Add spin_is_locked_other
For lock elision spin_is_locked() aborts because it cannot give the correct
answer locks hold by the same CPU. The correct answer is given only
when reexecuting non transactional.
However it can give an correct (or at least useful) answer for locks
hold by another CPU, even without aborting. So in this case it's useful
to have a different primitive that expresses this, so the underlying
lock code knows when to abort and when not.
This is very rare, but ipc/sem.c actually uses this legitimatiley to synchronize
with a global lock.
So add a spin_is_locked_other() for use by this.
Generic code, can be enabled per architecture.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
1 file changed