diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2009-11-09 10:21:34 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2009-11-13 14:53:28 -0500 |
commit | 6beb000923882f6204ea2cfcd932e568e900803f (patch) | |
tree | 1849bb1e7493bbf5e538d74cec18c6d6f4b16ced /kernel/spinlock.c | |
parent | 156171c71a0dc4bce12b4408bb1591f8fe32dc1a (diff) |
locking: Make inlining decision Kconfig based
commit 892a7c67 (locking: Allow arch-inlined spinlocks) implements the
selection of which lock functions are inlined based on defines in
arch/.../spinlock.h: #define __always_inline__LOCK_FUNCTION
Despite of the name __always_inline__* the lock functions can be built
out of line depending on config options. Also if the arch does not set
some inline defines the generic code might set them; again depending on
config options.
This makes it unnecessary hard to figure out when and which lock
functions are inlined. Aside of that it makes it way harder and
messier for -rt to manipulate the lock functions.
Convert the inlining decision to CONFIG switches. Each lock function
is inlined depending on CONFIG_INLINE_*. The configs implement the
existing dependencies. The architecture code can select ARCH_INLINE_*
to signal that it wants the corresponding lock function inlined.
ARCH_INLINE_* is necessary as Kconfig ignores "depends on"
restrictions when a config element is selected.
No functional change.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
LKML-Reference: <20091109151428.504477141@linutronix.de>
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Reviewed-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Diffstat (limited to 'kernel/spinlock.c')
-rw-r--r-- | kernel/spinlock.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/kernel/spinlock.c b/kernel/spinlock.c index 5ddab730cb2f..235a9579a875 100644 --- a/kernel/spinlock.c +++ b/kernel/spinlock.c | |||
@@ -21,7 +21,7 @@ | |||
21 | #include <linux/debug_locks.h> | 21 | #include <linux/debug_locks.h> |
22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
23 | 23 | ||
24 | #ifndef _spin_trylock | 24 | #ifndef CONFIG_INLINE_SPIN_TRYLOCK |
25 | int __lockfunc _spin_trylock(spinlock_t *lock) | 25 | int __lockfunc _spin_trylock(spinlock_t *lock) |
26 | { | 26 | { |
27 | return __spin_trylock(lock); | 27 | return __spin_trylock(lock); |
@@ -29,7 +29,7 @@ int __lockfunc _spin_trylock(spinlock_t *lock) | |||
29 | EXPORT_SYMBOL(_spin_trylock); | 29 | EXPORT_SYMBOL(_spin_trylock); |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | #ifndef _read_trylock | 32 | #ifndef CONFIG_INLINE_READ_TRYLOCK |
33 | int __lockfunc _read_trylock(rwlock_t *lock) | 33 | int __lockfunc _read_trylock(rwlock_t *lock) |
34 | { | 34 | { |
35 | return __read_trylock(lock); | 35 | return __read_trylock(lock); |
@@ -37,7 +37,7 @@ int __lockfunc _read_trylock(rwlock_t *lock) | |||
37 | EXPORT_SYMBOL(_read_trylock); | 37 | EXPORT_SYMBOL(_read_trylock); |
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | #ifndef _write_trylock | 40 | #ifndef CONFIG_INLINE_WRITE_TRYLOCK |
41 | int __lockfunc _write_trylock(rwlock_t *lock) | 41 | int __lockfunc _write_trylock(rwlock_t *lock) |
42 | { | 42 | { |
43 | return __write_trylock(lock); | 43 | return __write_trylock(lock); |
@@ -52,7 +52,7 @@ EXPORT_SYMBOL(_write_trylock); | |||
52 | */ | 52 | */ |
53 | #if !defined(CONFIG_GENERIC_LOCKBREAK) || defined(CONFIG_DEBUG_LOCK_ALLOC) | 53 | #if !defined(CONFIG_GENERIC_LOCKBREAK) || defined(CONFIG_DEBUG_LOCK_ALLOC) |
54 | 54 | ||
55 | #ifndef _read_lock | 55 | #ifndef CONFIG_INLINE_READ_LOCK |
56 | void __lockfunc _read_lock(rwlock_t *lock) | 56 | void __lockfunc _read_lock(rwlock_t *lock) |
57 | { | 57 | { |
58 | __read_lock(lock); | 58 | __read_lock(lock); |
@@ -60,7 +60,7 @@ void __lockfunc _read_lock(rwlock_t *lock) | |||
60 | EXPORT_SYMBOL(_read_lock); | 60 | EXPORT_SYMBOL(_read_lock); |
61 | #endif | 61 | #endif |
62 | 62 | ||
63 | #ifndef _spin_lock_irqsave | 63 | #ifndef CONFIG_INLINE_SPIN_LOCK_IRQSAVE |
64 | unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock) | 64 | unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock) |
65 | { | 65 | { |
66 | return __spin_lock_irqsave(lock); | 66 | return __spin_lock_irqsave(lock); |
@@ -68,7 +68,7 @@ unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock) | |||
68 | EXPORT_SYMBOL(_spin_lock_irqsave); | 68 | EXPORT_SYMBOL(_spin_lock_irqsave); |
69 | #endif | 69 | #endif |
70 | 70 | ||
71 | #ifndef _spin_lock_irq | 71 | #ifndef CONFIG_INLINE_SPIN_LOCK_IRQ |
72 | void __lockfunc _spin_lock_irq(spinlock_t *lock) | 72 | void __lockfunc _spin_lock_irq(spinlock_t *lock) |
73 | { | 73 | { |
74 | __spin_lock_irq(lock); | 74 | __spin_lock_irq(lock); |
@@ -76,7 +76,7 @@ void __lockfunc _spin_lock_irq(spinlock_t *lock) | |||
76 | EXPORT_SYMBOL(_spin_lock_irq); | 76 | EXPORT_SYMBOL(_spin_lock_irq); |
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | #ifndef _spin_lock_bh | 79 | #ifndef CONFIG_INLINE_SPIN_LOCK_BH |
80 | void __lockfunc _spin_lock_bh(spinlock_t *lock) | 80 | void __lockfunc _spin_lock_bh(spinlock_t *lock) |
81 | { | 81 | { |
82 | __spin_lock_bh(lock); | 82 | __spin_lock_bh(lock); |
@@ -84,7 +84,7 @@ void __lockfunc _spin_lock_bh(spinlock_t *lock) | |||
84 | EXPORT_SYMBOL(_spin_lock_bh); | 84 | EXPORT_SYMBOL(_spin_lock_bh); |
85 | #endif | 85 | #endif |
86 | 86 | ||
87 | #ifndef _read_lock_irqsave | 87 | #ifndef CONFIG_INLINE_READ_LOCK_IRQSAVE |
88 | unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock) | 88 | unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock) |
89 | { | 89 | { |
90 | return __read_lock_irqsave(lock); | 90 | return __read_lock_irqsave(lock); |
@@ -92,7 +92,7 @@ unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock) | |||
92 | EXPORT_SYMBOL(_read_lock_irqsave); | 92 | EXPORT_SYMBOL(_read_lock_irqsave); |
93 | #endif | 93 | #endif |
94 | 94 | ||
95 | #ifndef _read_lock_irq | 95 | #ifndef CONFIG_INLINE_READ_LOCK_IRQ |
96 | void __lockfunc _read_lock_irq(rwlock_t *lock) | 96 | void __lockfunc _read_lock_irq(rwlock_t *lock) |
97 | { | 97 | { |
98 | __read_lock_irq(lock); | 98 | __read_lock_irq(lock); |
@@ -100,7 +100,7 @@ void __lockfunc _read_lock_irq(rwlock_t *lock) | |||
100 | EXPORT_SYMBOL(_read_lock_irq); | 100 | EXPORT_SYMBOL(_read_lock_irq); |
101 | #endif | 101 | #endif |
102 | 102 | ||
103 | #ifndef _read_lock_bh | 103 | #ifndef CONFIG_INLINE_READ_LOCK_BH |
104 | void __lockfunc _read_lock_bh(rwlock_t *lock) | 104 | void __lockfunc _read_lock_bh(rwlock_t *lock) |
105 | { | 105 | { |
106 | __read_lock_bh(lock); | 106 | __read_lock_bh(lock); |
@@ -108,7 +108,7 @@ void __lockfunc _read_lock_bh(rwlock_t *lock) | |||
108 | EXPORT_SYMBOL(_read_lock_bh); | 108 | EXPORT_SYMBOL(_read_lock_bh); |
109 | #endif | 109 | #endif |
110 | 110 | ||
111 | #ifndef _write_lock_irqsave | 111 | #ifndef CONFIG_INLINE_WRITE_LOCK_IRQSAVE |
112 | unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock) | 112 | unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock) |
113 | { | 113 | { |
114 | return __write_lock_irqsave(lock); | 114 | return __write_lock_irqsave(lock); |
@@ -116,7 +116,7 @@ unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock) | |||
116 | EXPORT_SYMBOL(_write_lock_irqsave); | 116 | EXPORT_SYMBOL(_write_lock_irqsave); |
117 | #endif | 117 | #endif |
118 | 118 | ||
119 | #ifndef _write_lock_irq | 119 | #ifndef CONFIG_INLINE_WRITE_LOCK_IRQ |
120 | void __lockfunc _write_lock_irq(rwlock_t *lock) | 120 | void __lockfunc _write_lock_irq(rwlock_t *lock) |
121 | { | 121 | { |
122 | __write_lock_irq(lock); | 122 | __write_lock_irq(lock); |
@@ -124,7 +124,7 @@ void __lockfunc _write_lock_irq(rwlock_t *lock) | |||
124 | EXPORT_SYMBOL(_write_lock_irq); | 124 | EXPORT_SYMBOL(_write_lock_irq); |
125 | #endif | 125 | #endif |
126 | 126 | ||
127 | #ifndef _write_lock_bh | 127 | #ifndef CONFIG_INLINE_WRITE_LOCK_BH |
128 | void __lockfunc _write_lock_bh(rwlock_t *lock) | 128 | void __lockfunc _write_lock_bh(rwlock_t *lock) |
129 | { | 129 | { |
130 | __write_lock_bh(lock); | 130 | __write_lock_bh(lock); |
@@ -132,7 +132,7 @@ void __lockfunc _write_lock_bh(rwlock_t *lock) | |||
132 | EXPORT_SYMBOL(_write_lock_bh); | 132 | EXPORT_SYMBOL(_write_lock_bh); |
133 | #endif | 133 | #endif |
134 | 134 | ||
135 | #ifndef _spin_lock | 135 | #ifndef CONFIG_INLINE_SPIN_LOCK |
136 | void __lockfunc _spin_lock(spinlock_t *lock) | 136 | void __lockfunc _spin_lock(spinlock_t *lock) |
137 | { | 137 | { |
138 | __spin_lock(lock); | 138 | __spin_lock(lock); |
@@ -140,7 +140,7 @@ void __lockfunc _spin_lock(spinlock_t *lock) | |||
140 | EXPORT_SYMBOL(_spin_lock); | 140 | EXPORT_SYMBOL(_spin_lock); |
141 | #endif | 141 | #endif |
142 | 142 | ||
143 | #ifndef _write_lock | 143 | #ifndef CONFIG_INLINE_WRITE_LOCK |
144 | void __lockfunc _write_lock(rwlock_t *lock) | 144 | void __lockfunc _write_lock(rwlock_t *lock) |
145 | { | 145 | { |
146 | __write_lock(lock); | 146 | __write_lock(lock); |
@@ -272,7 +272,7 @@ EXPORT_SYMBOL(_spin_lock_nest_lock); | |||
272 | 272 | ||
273 | #endif | 273 | #endif |
274 | 274 | ||
275 | #ifndef _spin_unlock | 275 | #ifndef CONFIG_INLINE_SPIN_UNLOCK |
276 | void __lockfunc _spin_unlock(spinlock_t *lock) | 276 | void __lockfunc _spin_unlock(spinlock_t *lock) |
277 | { | 277 | { |
278 | __spin_unlock(lock); | 278 | __spin_unlock(lock); |
@@ -280,7 +280,7 @@ void __lockfunc _spin_unlock(spinlock_t *lock) | |||
280 | EXPORT_SYMBOL(_spin_unlock); | 280 | EXPORT_SYMBOL(_spin_unlock); |
281 | #endif | 281 | #endif |
282 | 282 | ||
283 | #ifndef _write_unlock | 283 | #ifndef CONFIG_INLINE_WRITE_UNLOCK |
284 | void __lockfunc _write_unlock(rwlock_t *lock) | 284 | void __lockfunc _write_unlock(rwlock_t *lock) |
285 | { | 285 | { |
286 | __write_unlock(lock); | 286 | __write_unlock(lock); |
@@ -288,7 +288,7 @@ void __lockfunc _write_unlock(rwlock_t *lock) | |||
288 | EXPORT_SYMBOL(_write_unlock); | 288 | EXPORT_SYMBOL(_write_unlock); |
289 | #endif | 289 | #endif |
290 | 290 | ||
291 | #ifndef _read_unlock | 291 | #ifndef CONFIG_INLINE_READ_UNLOCK |
292 | void __lockfunc _read_unlock(rwlock_t *lock) | 292 | void __lockfunc _read_unlock(rwlock_t *lock) |
293 | { | 293 | { |
294 | __read_unlock(lock); | 294 | __read_unlock(lock); |
@@ -296,7 +296,7 @@ void __lockfunc _read_unlock(rwlock_t *lock) | |||
296 | EXPORT_SYMBOL(_read_unlock); | 296 | EXPORT_SYMBOL(_read_unlock); |
297 | #endif | 297 | #endif |
298 | 298 | ||
299 | #ifndef _spin_unlock_irqrestore | 299 | #ifndef CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE |
300 | void __lockfunc _spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags) | 300 | void __lockfunc _spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags) |
301 | { | 301 | { |
302 | __spin_unlock_irqrestore(lock, flags); | 302 | __spin_unlock_irqrestore(lock, flags); |
@@ -304,7 +304,7 @@ void __lockfunc _spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags) | |||
304 | EXPORT_SYMBOL(_spin_unlock_irqrestore); | 304 | EXPORT_SYMBOL(_spin_unlock_irqrestore); |
305 | #endif | 305 | #endif |
306 | 306 | ||
307 | #ifndef _spin_unlock_irq | 307 | #ifndef CONFIG_INLINE_SPIN_UNLOCK_IRQ |
308 | void __lockfunc _spin_unlock_irq(spinlock_t *lock) | 308 | void __lockfunc _spin_unlock_irq(spinlock_t *lock) |
309 | { | 309 | { |
310 | __spin_unlock_irq(lock); | 310 | __spin_unlock_irq(lock); |
@@ -312,7 +312,7 @@ void __lockfunc _spin_unlock_irq(spinlock_t *lock) | |||
312 | EXPORT_SYMBOL(_spin_unlock_irq); | 312 | EXPORT_SYMBOL(_spin_unlock_irq); |
313 | #endif | 313 | #endif |
314 | 314 | ||
315 | #ifndef _spin_unlock_bh | 315 | #ifndef CONFIG_INLINE_SPIN_UNLOCK_BH |
316 | void __lockfunc _spin_unlock_bh(spinlock_t *lock) | 316 | void __lockfunc _spin_unlock_bh(spinlock_t *lock) |
317 | { | 317 | { |
318 | __spin_unlock_bh(lock); | 318 | __spin_unlock_bh(lock); |
@@ -320,7 +320,7 @@ void __lockfunc _spin_unlock_bh(spinlock_t *lock) | |||
320 | EXPORT_SYMBOL(_spin_unlock_bh); | 320 | EXPORT_SYMBOL(_spin_unlock_bh); |
321 | #endif | 321 | #endif |
322 | 322 | ||
323 | #ifndef _read_unlock_irqrestore | 323 | #ifndef CONFIG_INLINE_READ_UNLOCK_IRQRESTORE |
324 | void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | 324 | void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) |
325 | { | 325 | { |
326 | __read_unlock_irqrestore(lock, flags); | 326 | __read_unlock_irqrestore(lock, flags); |
@@ -328,7 +328,7 @@ void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | |||
328 | EXPORT_SYMBOL(_read_unlock_irqrestore); | 328 | EXPORT_SYMBOL(_read_unlock_irqrestore); |
329 | #endif | 329 | #endif |
330 | 330 | ||
331 | #ifndef _read_unlock_irq | 331 | #ifndef CONFIG_INLINE_READ_UNLOCK_IRQ |
332 | void __lockfunc _read_unlock_irq(rwlock_t *lock) | 332 | void __lockfunc _read_unlock_irq(rwlock_t *lock) |
333 | { | 333 | { |
334 | __read_unlock_irq(lock); | 334 | __read_unlock_irq(lock); |
@@ -336,7 +336,7 @@ void __lockfunc _read_unlock_irq(rwlock_t *lock) | |||
336 | EXPORT_SYMBOL(_read_unlock_irq); | 336 | EXPORT_SYMBOL(_read_unlock_irq); |
337 | #endif | 337 | #endif |
338 | 338 | ||
339 | #ifndef _read_unlock_bh | 339 | #ifndef CONFIG_INLINE_READ_UNLOCK_BH |
340 | void __lockfunc _read_unlock_bh(rwlock_t *lock) | 340 | void __lockfunc _read_unlock_bh(rwlock_t *lock) |
341 | { | 341 | { |
342 | __read_unlock_bh(lock); | 342 | __read_unlock_bh(lock); |
@@ -344,7 +344,7 @@ void __lockfunc _read_unlock_bh(rwlock_t *lock) | |||
344 | EXPORT_SYMBOL(_read_unlock_bh); | 344 | EXPORT_SYMBOL(_read_unlock_bh); |
345 | #endif | 345 | #endif |
346 | 346 | ||
347 | #ifndef _write_unlock_irqrestore | 347 | #ifndef CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE |
348 | void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | 348 | void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) |
349 | { | 349 | { |
350 | __write_unlock_irqrestore(lock, flags); | 350 | __write_unlock_irqrestore(lock, flags); |
@@ -352,7 +352,7 @@ void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | |||
352 | EXPORT_SYMBOL(_write_unlock_irqrestore); | 352 | EXPORT_SYMBOL(_write_unlock_irqrestore); |
353 | #endif | 353 | #endif |
354 | 354 | ||
355 | #ifndef _write_unlock_irq | 355 | #ifndef CONFIG_INLINE_WRITE_UNLOCK_IRQ |
356 | void __lockfunc _write_unlock_irq(rwlock_t *lock) | 356 | void __lockfunc _write_unlock_irq(rwlock_t *lock) |
357 | { | 357 | { |
358 | __write_unlock_irq(lock); | 358 | __write_unlock_irq(lock); |
@@ -360,7 +360,7 @@ void __lockfunc _write_unlock_irq(rwlock_t *lock) | |||
360 | EXPORT_SYMBOL(_write_unlock_irq); | 360 | EXPORT_SYMBOL(_write_unlock_irq); |
361 | #endif | 361 | #endif |
362 | 362 | ||
363 | #ifndef _write_unlock_bh | 363 | #ifndef CONFIG_INLINE_WRITE_UNLOCK_BH |
364 | void __lockfunc _write_unlock_bh(rwlock_t *lock) | 364 | void __lockfunc _write_unlock_bh(rwlock_t *lock) |
365 | { | 365 | { |
366 | __write_unlock_bh(lock); | 366 | __write_unlock_bh(lock); |
@@ -368,7 +368,7 @@ void __lockfunc _write_unlock_bh(rwlock_t *lock) | |||
368 | EXPORT_SYMBOL(_write_unlock_bh); | 368 | EXPORT_SYMBOL(_write_unlock_bh); |
369 | #endif | 369 | #endif |
370 | 370 | ||
371 | #ifndef _spin_trylock_bh | 371 | #ifndef CONFIG_INLINE_SPIN_TRYLOCK_BH |
372 | int __lockfunc _spin_trylock_bh(spinlock_t *lock) | 372 | int __lockfunc _spin_trylock_bh(spinlock_t *lock) |
373 | { | 373 | { |
374 | return __spin_trylock_bh(lock); | 374 | return __spin_trylock_bh(lock); |