Messages in this thread Patch in this message | | | Date | Fri, 9 May 2008 09:28:14 -0700 (PDT) | From | Christoph Lameter <> | Subject | Re: Spinlocks: Factor our GENERIC_LOCKBREAK in order to avoid spin with irqs disable |
| |
On Fri, 9 May 2008, Ingo Molnar wrote:
> hm, there was some lockdep complication in this area. I guess we could > use the 'nice' variants too if their irq-enabling/disabling was properly > lockdep annotated and tracked by the irqflags machinery?
I thought that we already fall back to the functions that spin while having interrupts disabled if lockdep is on?
One issue: The BREAKLOCK value needs to be 1 in the fallback case otherwise we needlessly run atomic ops.
--- kernel/spinlock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Index: linux-2.6/kernel/spinlock.c =================================================================== --- linux-2.6.orig/kernel/spinlock.c 2008-05-07 16:00:06.000000000 -0700 +++ linux-2.6/kernel/spinlock.c 2008-05-07 16:00:29.000000000 -0700 @@ -218,7 +218,7 @@ do { \ #else -#define BREAKLOCK(lock) 0 +#define BREAKLOCK(lock) 1 #define BREAKLOCK_ENABLE(lock) do { } while (0) #define BREAKLOCK_DISABLE(lock) do { } while (0)
| |