diff options
author | Waiman Long <longman@redhat.com> | 2021-02-10 21:16:31 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-02-11 15:59:54 +0300 |
commit | d8d0da4eee5c4e86ea08abde6975848376b4ac13 (patch) | |
tree | df7d562b9d39161d947da8ddd68f07f0cfda43d7 /include/asm-generic/qrwlock.h | |
parent | 9294b8a12585f8b4ccb9c060b54bab0bd13f24b9 (diff) | |
download | linux-d8d0da4eee5c4e86ea08abde6975848376b4ac13.tar.xz |
locking/arch: Move qrwlock.h include after qspinlock.h
include/asm-generic/qrwlock.h was trying to get arch_spin_is_locked via
asm-generic/qspinlock.h. However, this does not work because architectures
might be using queued rwlocks but not queued spinlocks (csky), or because they
might be defining their own queued_* macros before including asm/qspinlock.h.
To fix this, ensure that asm/spinlock.h always includes qrwlock.h after
defining arch_spin_is_locked (either directly for csky, or via
asm/qspinlock.h for other architectures). The only inclusion elsewhere
is in kernel/locking/qrwlock.c. That one is really unnecessary because
the file is only compiled in SMP configurations (config QUEUED_RWLOCKS
depends on SMP) and in that case linux/spinlock.h already includes
asm/qrwlock.h if needed, via asm/spinlock.h.
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Waiman Long <longman@redhat.com>
Fixes: 26128cb6c7e6 ("locking/rwlocks: Add contention detection for rwlocks")
Tested-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Ben Gardon <bgardon@google.com>
[Add arch/sparc and kernel/locking parts per discussion with Waiman. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/asm-generic/qrwlock.h')
-rw-r--r-- | include/asm-generic/qrwlock.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/asm-generic/qrwlock.h b/include/asm-generic/qrwlock.h index 0020d3b820a7..7ae0ece07b4e 100644 --- a/include/asm-generic/qrwlock.h +++ b/include/asm-generic/qrwlock.h @@ -14,7 +14,8 @@ #include <asm/processor.h> #include <asm-generic/qrwlock_types.h> -#include <asm-generic/qspinlock.h> + +/* Must be included from asm/spinlock.h after defining arch_spin_is_locked. */ /* * Writer states & reader shift and bias. |