Commit
ddf1d169c0a489d498c1799a7043904a43b0c159
Exists in
smarc_imx_lf-5.15.y
and in
32 other branches
8mp-imx_5.4.70_2.3.0, 8qm-imx_5.4.70_2.3.0, emb_imx_lf-5.15.y, emb_lf-6.1.y, imx_4.1.15_1.0.0_ga, pitx_8mp_lf-5.10.y, rt-smarc-imx_4.1.15_1.0.0_ga, rt_linux_5.15.71, smarc-8m-android-11.0.0_2.0.0, smarc-imx6_4.14.98_2.0.0_ga, smarc-imx6_4.9.88_2.0.0_ga, smarc-imx7_4.14.98_2.0.0_ga, smarc-imx7_4.9.11_1.0.0_ga, smarc-imx7_4.9.88_2.0.0_ga, smarc-imx_4.1.15_1.0.0_ga, smarc-imx_4.9.11_1.0.0_ga, smarc-imx_4.9.51_imx8m_ga, smarc-imx_4.9.88_2.0.0_ga, smarc-m6.0.1_2.1.0-ga, smarc-n7.1.2_2.0.0-ga, smarc-rel_imx_4.1.15_1.2.0_ga, smarc_8m_00d0_imx_4.14.98_2.0.0_ga, smarc_8m_imx_4.14.78_1.0.0_ga, smarc_8m_imx_4.14.98_2.0.0_ga, smarc_8m_imx_4.19.35_1.1.0, smarc_8mm_imx_4.14.78_1.0.0_ga, smarc_8mm_imx_4.14.98_2.0.0_ga, smarc_8mm_imx_4.19.35_1.1.0, smarc_8mm_imx_5.4.24_2.1.0, smarc_8mp_lf-5.10.y, smarc_8mq_imx_5.4.24_2.1.0, smarc_8mq_lf-5.10.y
locking/mcs: Allow architecture specific asm files to be used for contended case
This patch allows each architecture to add its specific assembly optimized
arch_mcs_spin_lock_contended and arch_mcs_spinlock_uncontended for
MCS lock and unlock functions.
Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Scott J Norton <scott.norton@hp.com>
Cc: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
Cc: AswinChandramouleeswaran <aswin@hp.com>
Cc: George Spelvin <linux@horizon.com>
Cc: Rik vanRiel <riel@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: MichelLespinasse <walken@google.com>
Cc: Peter Hurley <peter@hurleysoftware.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Alex Shi <alex.shi@linaro.org>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: "Figo.zhang" <figo1802@gmail.com>
Cc: "Paul E.McKenney" <paulmck@linux.vnet.ibm.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Davidlohr Bueso <davidlohr.bueso@hp.com>
Cc: Waiman Long <waiman.long@hp.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matthew R Wilcox <matthew.r.wilcox@intel.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1390347382.3138.67.camel@schen9-DESK
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Showing
31 changed files
with
44 additions
and
0 deletions
Side-by-side Diff
... |
... |
@@ -3,6 +3,7 @@ |
3
|
3 |
generic-y += clkdev.h |
4
|
4 |
generic-y += exec.h |
5
|
5 |
generic-y += hash.h |
|
6 |
+generic-y += mcs_spinlock.h |
6
|
7 |
generic-y += preempt.h |
7
|
8 |
generic-y += trace_clock.h |
... |
... |
@@ -22,6 +22,7 @@ |
22
|
22 |
generic-y += kvm_para.h |
23
|
23 |
generic-y += local.h |
24
|
24 |
generic-y += local64.h |
|
25 |
+generic-y += mcs_spinlock.h |
25
|
26 |
generic-y += mman.h |
26
|
27 |
generic-y += msgbuf.h |
27
|
28 |
generic-y += param.h |
... |
... |
@@ -14,6 +14,7 @@ |
14
|
14 |
generic-y += kdebug.h |
15
|
15 |
generic-y += local.h |
16
|
16 |
generic-y += local64.h |
|
17 |
+generic-y += mcs_spinlock.h |
17
|
18 |
generic-y += msgbuf.h |
18
|
19 |
generic-y += param.h |
19
|
20 |
generic-y += parport.h |
... |
... |
@@ -23,6 +23,7 @@ |
23
|
23 |
generic-y += kvm_para.h |
24
|
24 |
generic-y += local.h |
25
|
25 |
generic-y += local64.h |
|
26 |
+generic-y += mcs_spinlock.h |
26
|
27 |
generic-y += mman.h |
27
|
28 |
generic-y += msgbuf.h |
28
|
29 |
generic-y += mutex.h |
... |
... |
@@ -11,6 +11,7 @@ |
11
|
11 |
generic-y += irq_regs.h |
12
|
12 |
generic-y += local.h |
13
|
13 |
generic-y += local64.h |
|
14 |
+generic-y += mcs_spinlock.h |
14
|
15 |
generic-y += param.h |
15
|
16 |
generic-y += percpu.h |
16
|
17 |
generic-y += preempt.h |
... |
... |
@@ -20,6 +20,7 @@ |
20
|
20 |
generic-y += kvm_para.h |
21
|
21 |
generic-y += local.h |
22
|
22 |
generic-y += local64.h |
|
23 |
+generic-y += mcs_spinlock.h |
23
|
24 |
generic-y += mman.h |
24
|
25 |
generic-y += msgbuf.h |
25
|
26 |
generic-y += mutex.h |
... |
... |
@@ -25,6 +25,7 @@ |
25
|
25 |
generic-y += kdebug.h |
26
|
26 |
generic-y += kmap_types.h |
27
|
27 |
generic-y += local.h |
|
28 |
+generic-y += mcs_spinlock.h |
28
|
29 |
generic-y += mman.h |
29
|
30 |
generic-y += mmu.h |
30
|
31 |
generic-y += mmu_context.h |
... |
... |
@@ -9,6 +9,7 @@ |
9
|
9 |
generic-y += hash.h |
10
|
10 |
generic-y += kvm_para.h |
11
|
11 |
generic-y += linkage.h |
|
12 |
+generic-y += mcs_spinlock.h |
12
|
13 |
generic-y += module.h |
13
|
14 |
generic-y += preempt.h |
14
|
15 |
generic-y += trace_clock.h |
... |
... |
@@ -2,6 +2,7 @@ |
2
|
2 |
generic-y += clkdev.h |
3
|
3 |
generic-y += exec.h |
4
|
4 |
generic-y += hash.h |
|
5 |
+generic-y += mcs_spinlock.h |
5
|
6 |
generic-y += preempt.h |
6
|
7 |
generic-y += trace_clock.h |
... |
... |
@@ -27,6 +27,7 @@ |
27
|
27 |
generic-y += kmap_types.h |
28
|
28 |
generic-y += local.h |
29
|
29 |
generic-y += local64.h |
|
30 |
+generic-y += mcs_spinlock.h |
30
|
31 |
generic-y += mman.h |
31
|
32 |
generic-y += msgbuf.h |
32
|
33 |
generic-y += pci.h |
... |
... |
@@ -3,6 +3,7 @@ |
3
|
3 |
generic-y += exec.h |
4
|
4 |
generic-y += hash.h |
5
|
5 |
generic-y += kvm_para.h |
|
6 |
+generic-y += mcs_spinlock.h |
6
|
7 |
generic-y += preempt.h |
7
|
8 |
generic-y += trace_clock.h |
8
|
9 |
generic-y += vtime.h |
... |
... |
@@ -2,6 +2,7 @@ |
2
|
2 |
generic-y += clkdev.h |
3
|
3 |
generic-y += exec.h |
4
|
4 |
generic-y += hash.h |
|
5 |
+generic-y += mcs_spinlock.h |
5
|
6 |
generic-y += module.h |
6
|
7 |
generic-y += preempt.h |
7
|
8 |
generic-y += trace_clock.h |
... |
... |
@@ -16,6 +16,7 @@ |
16
|
16 |
generic-y += kvm_para.h |
17
|
17 |
generic-y += local.h |
18
|
18 |
generic-y += local64.h |
|
19 |
+generic-y += mcs_spinlock.h |
19
|
20 |
generic-y += mman.h |
20
|
21 |
generic-y += mutex.h |
21
|
22 |
generic-y += percpu.h |
... |
... |
@@ -24,6 +24,7 @@ |
24
|
24 |
generic-y += kvm_para.h |
25
|
25 |
generic-y += local.h |
26
|
26 |
generic-y += local64.h |
|
27 |
+generic-y += mcs_spinlock.h |
27
|
28 |
generic-y += msgbuf.h |
28
|
29 |
generic-y += mutex.h |
29
|
30 |
generic-y += param.h |
... |
... |
@@ -3,6 +3,7 @@ |
3
|
3 |
generic-y += clkdev.h |
4
|
4 |
generic-y += exec.h |
5
|
5 |
generic-y += hash.h |
|
6 |
+generic-y += mcs_spinlock.h |
6
|
7 |
generic-y += preempt.h |
7
|
8 |
generic-y += syscalls.h |
8
|
9 |
generic-y += trace_clock.h |
... |
... |
@@ -4,6 +4,7 @@ |
4
|
4 |
generic-y += emergency-restart.h |
5
|
5 |
generic-y += hash.h |
6
|
6 |
generic-y += local64.h |
|
7 |
+generic-y += mcs_spinlock.h |
7
|
8 |
generic-y += mutex.h |
8
|
9 |
generic-y += parport.h |
9
|
10 |
generic-y += percpu.h |
... |
... |
@@ -3,6 +3,7 @@ |
3
|
3 |
generic-y += clkdev.h |
4
|
4 |
generic-y += exec.h |
5
|
5 |
generic-y += hash.h |
|
6 |
+generic-y += mcs_spinlock.h |
6
|
7 |
generic-y += preempt.h |
7
|
8 |
generic-y += trace_clock.h |
... |
... |
@@ -35,6 +35,7 @@ |
35
|
35 |
generic-y += kmap_types.h |
36
|
36 |
generic-y += kvm_para.h |
37
|
37 |
generic-y += local.h |
|
38 |
+generic-y += mcs_spinlock.h |
38
|
39 |
generic-y += mman.h |
39
|
40 |
generic-y += module.h |
40
|
41 |
generic-y += msgbuf.h |
... |
... |
@@ -14,6 +14,7 @@ |
14
|
14 |
generic-y += kvm_para.h |
15
|
15 |
generic-y += local.h |
16
|
16 |
generic-y += local64.h |
|
17 |
+generic-y += mcs_spinlock.h |
17
|
18 |
generic-y += mutex.h |
18
|
19 |
generic-y += param.h |
19
|
20 |
generic-y += percpu.h |
1
|
1 |
|
2
|
2 |
generic-y += clkdev.h |
3
|
3 |
generic-y += hash.h |
|
4 |
+generic-y += mcs_spinlock.h |
4
|
5 |
generic-y += preempt.h |
5
|
6 |
generic-y += rwsem.h |
6
|
7 |
generic-y += trace_clock.h |
... |
... |
@@ -2,6 +2,7 @@ |
2
|
2 |
|
3
|
3 |
generic-y += clkdev.h |
4
|
4 |
generic-y += hash.h |
|
5 |
+generic-y += mcs_spinlock.h |
5
|
6 |
generic-y += preempt.h |
6
|
7 |
generic-y += trace_clock.h |
... |
... |
@@ -5,6 +5,7 @@ |
5
|
5 |
generic-y += barrier.h |
6
|
6 |
generic-y += clkdev.h |
7
|
7 |
generic-y += hash.h |
|
8 |
+generic-y += mcs_spinlock.h |
8
|
9 |
generic-y += preempt.h |
9
|
10 |
generic-y += trace_clock.h |
10
|
11 |
generic-y += xor.h |
... |
... |
@@ -15,6 +15,7 @@ |
15
|
15 |
generic-y += kvm_para.h |
16
|
16 |
generic-y += local.h |
17
|
17 |
generic-y += local64.h |
|
18 |
+generic-y += mcs_spinlock.h |
18
|
19 |
generic-y += mman.h |
19
|
20 |
generic-y += msgbuf.h |
20
|
21 |
generic-y += param.h |
... |
... |
@@ -11,6 +11,7 @@ |
11
|
11 |
generic-y += linkage.h |
12
|
12 |
generic-y += local.h |
13
|
13 |
generic-y += local64.h |
|
14 |
+generic-y += mcs_spinlock.h |
14
|
15 |
generic-y += module.h |
15
|
16 |
generic-y += mutex.h |
16
|
17 |
generic-y += preempt.h |
... |
... |
@@ -19,6 +19,7 @@ |
19
|
19 |
generic-y += irq_regs.h |
20
|
20 |
generic-y += local.h |
21
|
21 |
generic-y += local64.h |
|
22 |
+generic-y += mcs_spinlock.h |
22
|
23 |
generic-y += msgbuf.h |
23
|
24 |
generic-y += mutex.h |
24
|
25 |
generic-y += param.h |
... |
... |
@@ -15,6 +15,7 @@ |
15
|
15 |
generic-y += io.h |
16
|
16 |
generic-y += irq_regs.h |
17
|
17 |
generic-y += kdebug.h |
|
18 |
+generic-y += mcs_spinlock.h |
18
|
19 |
generic-y += mutex.h |
19
|
20 |
generic-y += param.h |
20
|
21 |
generic-y += pci.h |
... |
... |
@@ -25,6 +25,7 @@ |
25
|
25 |
generic-y += kdebug.h |
26
|
26 |
generic-y += kmap_types.h |
27
|
27 |
generic-y += local.h |
|
28 |
+generic-y += mcs_spinlock.h |
28
|
29 |
generic-y += mman.h |
29
|
30 |
generic-y += module.h |
30
|
31 |
generic-y += msgbuf.h |
... |
... |
@@ -5,4 +5,5 @@ |
5
|
5 |
genhdr-y += unistd_x32.h |
6
|
6 |
|
7
|
7 |
generic-y += clkdev.h |
|
8 |
+generic-y += mcs_spinlock.h |
... |
... |
@@ -18,6 +18,7 @@ |
18
|
18 |
generic-y += linkage.h |
19
|
19 |
generic-y += local.h |
20
|
20 |
generic-y += local64.h |
|
21 |
+generic-y += mcs_spinlock.h |
21
|
22 |
generic-y += percpu.h |
22
|
23 |
generic-y += preempt.h |
23
|
24 |
generic-y += resource.h |
|
1 |
+#ifndef __ASM_MCS_SPINLOCK_H |
|
2 |
+#define __ASM_MCS_SPINLOCK_H |
|
3 |
+ |
|
4 |
+/* |
|
5 |
+ * Architectures can define their own: |
|
6 |
+ * |
|
7 |
+ * arch_mcs_spin_lock_contended(l) |
|
8 |
+ * arch_mcs_spin_unlock_contended(l) |
|
9 |
+ * |
|
10 |
+ * See kernel/locking/mcs_spinlock.c. |
|
11 |
+ */ |
|
12 |
+ |
|
13 |
+#endif /* __ASM_MCS_SPINLOCK_H */ |
... |
... |
@@ -12,6 +12,8 @@ |
12
|
12 |
#ifndef __LINUX_MCS_SPINLOCK_H |
13
|
13 |
#define __LINUX_MCS_SPINLOCK_H |
14
|
14 |
|
|
15 |
+#include <asm/mcs_spinlock.h> |
|
16 |
+ |
15
|
17 |
struct mcs_spinlock { |
16
|
18 |
struct mcs_spinlock *next; |
17
|
19 |
int locked; /* 1 if lock acquired */ |