diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2007-07-19 04:48:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 13:04:49 -0400 |
commit | 4fe87745a6722d42ff27a60768c77958fa1fc498 (patch) | |
tree | adb116303fda951e0f7fc997db5de683e1bd8527 /kernel/spinlock.c | |
parent | c46261de0d98372112d8edf16f74ce418a268d46 (diff) |
lockstat: hook into spinlock_t, rwlock_t, rwsem and mutex
Call the new lockstat tracking functions from the various lock primitives.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Jason Baron <jbaron@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/spinlock.c')
-rw-r--r-- | kernel/spinlock.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/kernel/spinlock.c b/kernel/spinlock.c index cd93bfe3f10d..cd72424c2662 100644 --- a/kernel/spinlock.c +++ b/kernel/spinlock.c | |||
@@ -72,7 +72,7 @@ void __lockfunc _read_lock(rwlock_t *lock) | |||
72 | { | 72 | { |
73 | preempt_disable(); | 73 | preempt_disable(); |
74 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); | 74 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); |
75 | _raw_read_lock(lock); | 75 | LOCK_CONTENDED(lock, _raw_read_trylock, _raw_read_lock); |
76 | } | 76 | } |
77 | EXPORT_SYMBOL(_read_lock); | 77 | EXPORT_SYMBOL(_read_lock); |
78 | 78 | ||
@@ -89,7 +89,7 @@ unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock) | |||
89 | * that interrupts are not re-enabled during lock-acquire: | 89 | * that interrupts are not re-enabled during lock-acquire: |
90 | */ | 90 | */ |
91 | #ifdef CONFIG_LOCKDEP | 91 | #ifdef CONFIG_LOCKDEP |
92 | _raw_spin_lock(lock); | 92 | LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); |
93 | #else | 93 | #else |
94 | _raw_spin_lock_flags(lock, &flags); | 94 | _raw_spin_lock_flags(lock, &flags); |
95 | #endif | 95 | #endif |
@@ -102,7 +102,7 @@ void __lockfunc _spin_lock_irq(spinlock_t *lock) | |||
102 | local_irq_disable(); | 102 | local_irq_disable(); |
103 | preempt_disable(); | 103 | preempt_disable(); |
104 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); | 104 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); |
105 | _raw_spin_lock(lock); | 105 | LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); |
106 | } | 106 | } |
107 | EXPORT_SYMBOL(_spin_lock_irq); | 107 | EXPORT_SYMBOL(_spin_lock_irq); |
108 | 108 | ||
@@ -111,7 +111,7 @@ void __lockfunc _spin_lock_bh(spinlock_t *lock) | |||
111 | local_bh_disable(); | 111 | local_bh_disable(); |
112 | preempt_disable(); | 112 | preempt_disable(); |
113 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); | 113 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); |
114 | _raw_spin_lock(lock); | 114 | LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); |
115 | } | 115 | } |
116 | EXPORT_SYMBOL(_spin_lock_bh); | 116 | EXPORT_SYMBOL(_spin_lock_bh); |
117 | 117 | ||
@@ -122,7 +122,7 @@ unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock) | |||
122 | local_irq_save(flags); | 122 | local_irq_save(flags); |
123 | preempt_disable(); | 123 | preempt_disable(); |
124 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); | 124 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); |
125 | _raw_read_lock(lock); | 125 | LOCK_CONTENDED(lock, _raw_read_trylock, _raw_read_lock); |
126 | return flags; | 126 | return flags; |
127 | } | 127 | } |
128 | EXPORT_SYMBOL(_read_lock_irqsave); | 128 | EXPORT_SYMBOL(_read_lock_irqsave); |
@@ -132,7 +132,7 @@ void __lockfunc _read_lock_irq(rwlock_t *lock) | |||
132 | local_irq_disable(); | 132 | local_irq_disable(); |
133 | preempt_disable(); | 133 | preempt_disable(); |
134 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); | 134 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); |
135 | _raw_read_lock(lock); | 135 | LOCK_CONTENDED(lock, _raw_read_trylock, _raw_read_lock); |
136 | } | 136 | } |
137 | EXPORT_SYMBOL(_read_lock_irq); | 137 | EXPORT_SYMBOL(_read_lock_irq); |
138 | 138 | ||
@@ -141,7 +141,7 @@ void __lockfunc _read_lock_bh(rwlock_t *lock) | |||
141 | local_bh_disable(); | 141 | local_bh_disable(); |
142 | preempt_disable(); | 142 | preempt_disable(); |
143 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); | 143 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); |
144 | _raw_read_lock(lock); | 144 | LOCK_CONTENDED(lock, _raw_read_trylock, _raw_read_lock); |
145 | } | 145 | } |
146 | EXPORT_SYMBOL(_read_lock_bh); | 146 | EXPORT_SYMBOL(_read_lock_bh); |
147 | 147 | ||
@@ -152,7 +152,7 @@ unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock) | |||
152 | local_irq_save(flags); | 152 | local_irq_save(flags); |
153 | preempt_disable(); | 153 | preempt_disable(); |
154 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); | 154 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); |
155 | _raw_write_lock(lock); | 155 | LOCK_CONTENDED(lock, _raw_write_trylock, _raw_write_lock); |
156 | return flags; | 156 | return flags; |
157 | } | 157 | } |
158 | EXPORT_SYMBOL(_write_lock_irqsave); | 158 | EXPORT_SYMBOL(_write_lock_irqsave); |
@@ -162,7 +162,7 @@ void __lockfunc _write_lock_irq(rwlock_t *lock) | |||
162 | local_irq_disable(); | 162 | local_irq_disable(); |
163 | preempt_disable(); | 163 | preempt_disable(); |
164 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); | 164 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); |
165 | _raw_write_lock(lock); | 165 | LOCK_CONTENDED(lock, _raw_write_trylock, _raw_write_lock); |
166 | } | 166 | } |
167 | EXPORT_SYMBOL(_write_lock_irq); | 167 | EXPORT_SYMBOL(_write_lock_irq); |
168 | 168 | ||
@@ -171,7 +171,7 @@ void __lockfunc _write_lock_bh(rwlock_t *lock) | |||
171 | local_bh_disable(); | 171 | local_bh_disable(); |
172 | preempt_disable(); | 172 | preempt_disable(); |
173 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); | 173 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); |
174 | _raw_write_lock(lock); | 174 | LOCK_CONTENDED(lock, _raw_write_trylock, _raw_write_lock); |
175 | } | 175 | } |
176 | EXPORT_SYMBOL(_write_lock_bh); | 176 | EXPORT_SYMBOL(_write_lock_bh); |
177 | 177 | ||
@@ -179,7 +179,7 @@ void __lockfunc _spin_lock(spinlock_t *lock) | |||
179 | { | 179 | { |
180 | preempt_disable(); | 180 | preempt_disable(); |
181 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); | 181 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); |
182 | _raw_spin_lock(lock); | 182 | LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); |
183 | } | 183 | } |
184 | 184 | ||
185 | EXPORT_SYMBOL(_spin_lock); | 185 | EXPORT_SYMBOL(_spin_lock); |
@@ -188,7 +188,7 @@ void __lockfunc _write_lock(rwlock_t *lock) | |||
188 | { | 188 | { |
189 | preempt_disable(); | 189 | preempt_disable(); |
190 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); | 190 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); |
191 | _raw_write_lock(lock); | 191 | LOCK_CONTENDED(lock, _raw_write_trylock, _raw_write_lock); |
192 | } | 192 | } |
193 | 193 | ||
194 | EXPORT_SYMBOL(_write_lock); | 194 | EXPORT_SYMBOL(_write_lock); |
@@ -289,7 +289,7 @@ void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass) | |||
289 | { | 289 | { |
290 | preempt_disable(); | 290 | preempt_disable(); |
291 | spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_); | 291 | spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_); |
292 | _raw_spin_lock(lock); | 292 | LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); |
293 | } | 293 | } |
294 | 294 | ||
295 | EXPORT_SYMBOL(_spin_lock_nested); | 295 | EXPORT_SYMBOL(_spin_lock_nested); |
@@ -306,7 +306,7 @@ unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclas | |||
306 | * that interrupts are not re-enabled during lock-acquire: | 306 | * that interrupts are not re-enabled during lock-acquire: |
307 | */ | 307 | */ |
308 | #ifdef CONFIG_LOCKDEP | 308 | #ifdef CONFIG_LOCKDEP |
309 | _raw_spin_lock(lock); | 309 | LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); |
310 | #else | 310 | #else |
311 | _raw_spin_lock_flags(lock, &flags); | 311 | _raw_spin_lock_flags(lock, &flags); |
312 | #endif | 312 | #endif |