Commit 2bb655c5 authored by Waiman Long's avatar Waiman Long Committed by Yu Zhang
Browse files

locking/arch: Move qrwlock.h include after qspinlock.h

mainline inclusion
from mainline-v5.12-rc1
commit d8d0da4e
category: feature
bugzilla: https://gitee.com/openeuler/intel-kernel/issues/I7S3VQ
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d8d0da4eee5c4e86ea08abde6975848376b4ac13



----------------------------------------------------------------------

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: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWaiman Long <longman@redhat.com>
Fixes: 26128cb6 ("locking/rwlocks: Add contention detection for rwlocks")
Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
Reviewed-by: default avatarBen Gardon <bgardon@google.com>
[Add arch/sparc and kernel/locking parts per discussion with Waiman. - Paolo]
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>

conflict:
	arch/arm64/include/asm/spinlock.h

Signed-off-by: default avatarYu Zhang <yu.c.zhang@linux.intel.com>
parent d3af3e66
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment