diff options
| author | Nicholas Piggin <npiggin@gmail.com> | 2022-11-28 13:11:13 +1000 |
|---|---|---|
| committer | Michael Ellerman <mpe@ellerman.id.au> | 2022-12-02 17:48:02 +1100 |
| commit | 9f61521c7a284e799050cd2adacc9a611bd2b491 (patch) | |
| tree | ea553dc89ef9d27ee506c2f76b413869fc352d31 /arch/powerpc/lib/qspinlock.c | |
| parent | Linux 6.1-rc2 (diff) | |
| download | linux-9f61521c7a284e799050cd2adacc9a611bd2b491.tar.gz linux-9f61521c7a284e799050cd2adacc9a611bd2b491.zip | |
powerpc/qspinlock: powerpc qspinlock implementation
Add a powerpc specific implementation of queued spinlocks. This is the
build framework with a very simple (non-queued) spinlock implementation
to begin with. Later changes add queueing, and other features and
optimisations one-at-a-time. It is done this way to more easily see how
the queued spinlocks are built, and to make performance and correctness
bisects more useful.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
[mpe: Drop paravirt.h & processor.h changes to fix 32-bit build]
[mpe: Fix 32-bit build of qspinlock.o & disallow GENERIC_LOCKBREAK per Nick]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/CONLLQB6DCJU.2ZPOS7T6S5GRR@bobo
Diffstat (limited to 'arch/powerpc/lib/qspinlock.c')
| -rw-r--r-- | arch/powerpc/lib/qspinlock.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/powerpc/lib/qspinlock.c b/arch/powerpc/lib/qspinlock.c new file mode 100644 index 000000000000..1c669b5b4607 --- /dev/null +++ b/arch/powerpc/lib/qspinlock.c @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +#include <linux/export.h> +#include <linux/processor.h> +#include <asm/qspinlock.h> + +void queued_spin_lock_slowpath(struct qspinlock *lock) +{ + while (!queued_spin_trylock(lock)) + cpu_relax(); +} +EXPORT_SYMBOL(queued_spin_lock_slowpath); + +#ifdef CONFIG_PARAVIRT_SPINLOCKS +void pv_spinlocks_init(void) +{ +} +#endif |
