path: root/kernel
diff options
authorRobin Holt <>2009-04-02 16:59:45 -0700
committerLinus Torvalds <>2009-04-02 19:05:10 -0700
commite8c158bb313c1df421eab7dc4299cd39cbbf5895 (patch)
tree8a5f1d01e58d0e358b2b0c9407fc494912e83c27 /kernel
parent41d577aa35aa0504fe28b76a948908bdb7fbec81 (diff)
Factor out #ifdefs from kernel/spinlock.c to LOCK_CONTENDED_FLAGS
SGI has observed that on large systems, interrupts are not serviced for a long period of time when waiting for a rwlock. The following patch series re-enables irqs while waiting for the lock, resembling the code which is already there for spinlocks. I only made the ia64 version, because the patch adds some overhead to the fast path. I assume there is currently no demand to have this for other architectures, because the systems are not so large. Of course, the possibility to implement raw_{read|write}_lock_flags for any architecture is still there. This patch: The new macro LOCK_CONTENDED_FLAGS expands to the correct implementation depending on the config options, so that IRQ's are re-enabled when possible, but they remain disabled if CONFIG_LOCKDEP is set. Signed-off-by: Petr Tesarik <> Signed-off-by: Robin Holt <> Cc: <> Cc: Ingo Molnar <> Cc: Peter Zijlstra <> Cc: "Luck, Tony" <> Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'kernel')
1 files changed, 2 insertions, 10 deletions
diff --git a/kernel/spinlock.c b/kernel/spinlock.c
index 29ab20749dd3..7283c6dc2d59 100644
--- a/kernel/spinlock.c
+++ b/kernel/spinlock.c
@@ -299,16 +299,8 @@ unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclas
spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_);
- /*
- * On lockdep we dont want the hand-coded irq-enable of
- * _raw_spin_lock_flags() code, because lockdep assumes
- * that interrupts are not re-enabled during lock-acquire:
- */
- LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock);
- _raw_spin_lock_flags(lock, &flags);
+ LOCK_CONTENDED_FLAGS(lock, _raw_spin_trylock, _raw_spin_lock,
+ _raw_spin_lock_flags, &flags);
return flags;