Johnny Hughes
2019-02-04 c1f36c28393a7bb126cbf436cd6a4077a5b5c313
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From 89bbb4b308e53d30daca20199b6039b64cd90fc1 Mon Sep 17 00:00:00 2001
From: Khuong Dinh <khuong.dinh@amperecomputing.com>
Date: Tue, 13 Mar 2018 21:17:01 +0000
Subject: [PATCH 04/11] BACKPORT: arm64: kconfig: Ensure spinlock fastpaths are
 inlined if !PREEMPT
 
When running with CONFIG_PREEMPT=n, the spinlock fastpaths fit inside
64 bytes, which typically coincides with the L1 I-cache line size.
 
Inline the spinlock fastpaths, like we do already for rwlocks.
 
This patch is required to fix kernel lock up due to new implementation of
queued read write locking from kernel 4.14.
This patch is backported from:
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20180913&id=5d168964aece0b4a41269839c613683c5d7e0fb2
 
Change-Id: I1d450877a4d589dcd78c080533e71d046c621562
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Khuong Dinh <khuong.dinh@amperecomputing.com>
---
 arch/arm64/Kconfig | 10 ++++++++++
 1 file changed, 10 insertions(+)
 
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index fba4bd7..db83519 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -39,6 +39,16 @@ config ARM64
     select ARCH_INLINE_WRITE_UNLOCK_BH if !PREEMPT
     select ARCH_INLINE_WRITE_UNLOCK_IRQ if !PREEMPT
     select ARCH_INLINE_WRITE_UNLOCK_IRQRESTORE if !PREEMPT
+    select ARCH_INLINE_SPIN_TRYLOCK if !PREEMPT
+    select ARCH_INLINE_SPIN_TRYLOCK_BH if !PREEMPT
+    select ARCH_INLINE_SPIN_LOCK if !PREEMPT
+    select ARCH_INLINE_SPIN_LOCK_BH if !PREEMPT
+    select ARCH_INLINE_SPIN_LOCK_IRQ if !PREEMPT
+    select ARCH_INLINE_SPIN_LOCK_IRQSAVE if !PREEMPT
+    select ARCH_INLINE_SPIN_UNLOCK if !PREEMPT
+    select ARCH_INLINE_SPIN_UNLOCK_BH if !PREEMPT
+    select ARCH_INLINE_SPIN_UNLOCK_IRQ if !PREEMPT
+    select ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE if !PREEMPT
     select ARCH_USE_CMPXCHG_LOCKREF
     select ARCH_USE_QUEUED_RWLOCKS
     select ARCH_USE_QUEUED_SPINLOCKS
-- 
1.8.3.1