Skip to contentSkip to conversation

lockmeter fix from tytso

PATCH New Hanna Linder 1 participant 1 message Apr 22, 2003 Locking primitives

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lockmeter fix from tytso

Hi,

This is a fix from Ted Ts'o that I have tested and ported to the 2.5.68-mm1 kernel. Here is the note from Ted describing the problem:

Quoted 7 lines

ridiculous hold times for a network spin lock that I *knew* wasn't right. What was happening was that networking code was using spin_lock_bh to enter the lock, did some work, then called a function which called spin_unlock to temporarily release the lock, and then called spin_lock. The top level function then called spin_unlock_bh. Because spin_{lock,unlock}_bh wasn't being metered, the result was ridiculous hold times.

Here is the patch. However, in order to test it I discovered that the config LOCKMETER part of the original patch has been dropped. I have included the code to add it back in for the i386 arch. Let me know if there was a reason to remove it from the config ;)

Thanks a lot for fixing the preempt problem too. I definitely owe you one...

Hanna

----------

arch/i386/Kconfig +7 -0
diff -Nrup -Xdontdiff linux-2.5.68-mm1/arch/i386/Kconfig linux-lockmeter/arch/i386/Kconfig
@@ -1573,6 +1573,13 @@ config DEBUG_SPINLOCK_SLEEP
 	  If you say Y here, various routines which may sleep will become very
 	  noisy if they are called with a spinlock held.	
 
+config LOCKMETER
+	bool "Kernel lock metering"
+	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.
+
 config KGDB
 	bool "Include kgdb kernel debugger"
 	depends on DEBUG_KERNEL
include/linux/spinlock.h +106 -0

124 lines not on this page · raw message