]> git.baikalelectronics.ru Git - kernel.git/commit
asm-generic: ticket-lock: New generic ticket-based spinlock
authorPeter Zijlstra <peterz@infradead.org>
Wed, 16 Mar 2022 22:53:54 +0000 (15:53 -0700)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 11 May 2022 18:49:38 +0000 (11:49 -0700)
commit836c909a3c6d77ec7ff30b53389b5948af4dfd41
tree636edf3d3261edb1191ee2a3301712f682c4afb6
parentdbb008736a8c113ef1e12b4e4b4351fac2a15ede
asm-generic: ticket-lock: New generic ticket-based spinlock

This is a simple, fair spinlock.  Specifically it doesn't have all the
subtle memory model dependencies that qspinlock has, which makes it more
suitable for simple systems as it is more likely to be correct.  It is
implemented entirely in terms of standard atomics and thus works fine
without any arch-specific code.

This replaces the existing asm-generic/spinlock.h, which just errored
out on SMP systems.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
include/asm-generic/spinlock.h
include/asm-generic/spinlock_types.h [new file with mode: 0644]