Skip to contentSkip to conversation

2.6.0-test9-mm4-lockmeter-preemption

PATCH New Joe Korty 1 participant 1 message Nov 20, 2003

lore
Share & tools
lore

Joe Korty

author
#0 lore raw

PATCH 1/1 2.6.0-test9-mm4-lockmeter-preemption

11/20/2003: base is 2.6.0-test9-mm4
o Fix lockmeter under preemption (i386 only)
o Fix compile warnings in kernel/lockmeter.c

Joe

arch/i386/Kconfig +1 -1
diff -ura base/arch/i386/Kconfig new/arch/i386/Kconfig
@@ -1300,7 +1300,7 @@
 	  
 config LOCKMETER
 	bool "Kernel lock metering"
-	depends on SMP && !PREEMPT
+	depends on SMP
 	help
 	  Say Y to enable kernel lock metering, which adds overhead to SMP locks,
 	  but allows you to see various statistics using the lockstat command.
include/asm-i386/spinlock.h +2 -0
diff -ura base/include/asm-i386/spinlock.h new/include/asm-i386/spinlock.h
@@ -270,10 +270,12 @@
 	return 0;
 
 slow_path:
+	preempt_disable();
 	_metered_spin_lock(lock);
 	if (atomic_dec_and_test(atomic))
 		return 1;
 	_metered_spin_unlock(lock);
+	preempt_enable();
 	return 0;
 }
 
kernel/lockmeter.c +1 -0
diff -ura base/kernel/lockmeter.c new/kernel/lockmeter.c
@@ -23,6 +23,7 @@
 #include <linux/vmalloc.h>
 #include <linux/spinlock.h>
 #include <linux/utsname.h>
+#include <linux/module.h>
 #include <asm/system.h>
 #include <asm/uaccess.h>