[PATCH] 2.6.0-test9-mm4-lockmeter-preemption

From: Joe Korty
Date: Thu Nov 20 2003 - 15:55:23 EST


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

diff -ura base/arch/i386/Kconfig new/arch/i386/Kconfig
--- base/arch/i386/Kconfig 2003-11-20 14:47:30.000000000 -0500
+++ new/arch/i386/Kconfig 2003-11-20 15:01:21.000000000 -0500
@@ -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.
diff -ura base/include/asm-i386/spinlock.h new/include/asm-i386/spinlock.h
--- base/include/asm-i386/spinlock.h 2003-11-20 14:47:30.000000000 -0500
+++ new/include/asm-i386/spinlock.h 2003-11-20 15:14:20.000000000 -0500
@@ -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;
}

diff -ura base/kernel/lockmeter.c new/kernel/lockmeter.c
--- base/kernel/lockmeter.c 2003-11-20 14:47:30.000000000 -0500
+++ new/kernel/lockmeter.c 2003-11-20 15:20:20.000000000 -0500
@@ -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>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/