lkml.org 
[lkml]   [2008]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: 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)


\
 
 \ /
  Last update: 2008-05-09 18:31    [W:0.080 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site