lockmeter
[Top] [All Lists]

Re: Lockmeter available for 2.4.0-test9 and 2.4.0-test10

To: John Hawkes <hawkes@xxxxxxxxxxxx>
Subject: Re: Lockmeter available for 2.4.0-test9 and 2.4.0-test10
From: Peter Rival <frival@xxxxxxxxxxx>
Date: Thu, 14 Dec 2000 07:24:23 -0500
Cc: lockmeter@xxxxxxxxxxx
Organization: Tru64 QMG Performance Engineering
References: <046d01c04b61$bca64ca0$6501a8c0@xxxxxxxxxxxxxxxxxxxx>
Sender: owner-lockmeter@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux 2.2.16-22smp i686; en-US; m18) Gecko/20001107 Netscape6/6.0
Hi John, all,

Please find attached a quick, simple patch to get lockmeter to work (simple compilation problems...) on Alpha. This has been tested up to 2.4.0-test11 I believe, and is stable on our GS80 running AIM 7 shared at 2000 users. :) Good code... ;)

 - Pete

John Hawkes wrote:

FYI, Lockmeter 1.4.4 is now available as a patch against linux
2.4.0-test9 and 2.4.0-test10, supporting i386, alpha, sparc64, mips64,
and ia64.  The patch can be found at:
   http://oss.sgi.com/projects/lockmeter/download
with more information at:
   http://oss.sgi.com/projects/lockmeter

John Hawkes
hawkes@xxxxxxxxxxxx
http://www.sgi.com/developers/oss/



diff -urN linux-2.4.0-test11-lockmeter/include/asm-alpha/spinlock.h 
linux-2.4.0-test11-lockmeter-alpha/include/asm-alpha/spinlock.h
--- linux-2.4.0-test11-lockmeter/include/asm-alpha/spinlock.h   Mon Dec 11 
14:44:37 2000
+++ linux-2.4.0-test11-lockmeter-alpha/include/asm-alpha/spinlock.h     Mon Dec 
11 12:09:27 2000
@@ -63,7 +63,6 @@
 #ifdef CONFIG_LOCKMETER
 extern void _spin_unlock_(spinlock_t *);
 #define spin_unlock(lock) _spin_unlock_(lock)
-
 static inline void nonmetered_spin_unlock(spinlock_t * lock)
 #else
 static inline void spin_unlock(spinlock_t * lock)
@@ -204,8 +203,7 @@
 #ifdef CONFIG_LOCKMETER
 extern void _read_unlock_(rwlock_t *);
 #define read_unlock(lock)  _read_unlock_(lock)
-
-static inline void nonmetered_write_unlock(rwlock_t * lock)
+static inline void nonmetered_read_unlock(rwlock_t * lock)
 #else
 static inline void read_unlock(rwlock_t * lock)
 #endif
@@ -225,6 +223,9 @@
 }
 
 #ifdef CONFIG_LOCKMETER
+extern int _write_trylock_(rwlock_t *lock);
+extern int _read_trylock_(rwlock_t *lock);
+
 static inline int nonmetered_write_trylock(rwlock_t *lock)
 {
        long temp,result;
@@ -243,9 +244,9 @@
        return (result);
 }
 
-extern inline int nonmetered_read_trylock(rwlock_t *lock)
+static inline int nonmetered_read_trylock(rwlock_t *lock)
 {
-long temp,result;
+       unsigned long temp,result;
 
        __asm__ __volatile__(
        "       ldl_l %1,%0\n"
@@ -254,10 +255,11 @@
        "       subl %1,2,%2\n"
        "       stl_c %2,%0\n"
        "1:     mb\n"
-       : "=m" (volatile int *)lock), "=&r" (temp), "=&r" (result)
-       : "m" (volatile int *)lock)
+       : "=m" (*(volatile int *)lock), "=&r" (temp), "=&r" (result)
+       : "m" (*(volatile int *)lock)
        );
        return (result);
 }
+#endif /* CONFIG_LOCKMETER */
 
 #endif /* _ALPHA_SPINLOCK_H */
diff -urN linux-2.4.0-test11-lockmeter/include/linux/lockmeter.h 
linux-2.4.0-test11-lockmeter-alpha/include/linux/lockmeter.h
--- linux-2.4.0-test11-lockmeter/include/linux/lockmeter.h      Mon Dec 11 
14:44:38 2000
+++ linux-2.4.0-test11-lockmeter-alpha/include/linux/lockmeter.h        Mon Dec 
11 12:29:13 2000
@@ -95,7 +95,7 @@
  * This value depends on how many bits are available in the 
  * lock word in the particular machine implementation we are on.
  */
-#define LSTAT_MAX_STAT_INDEX           2000
+#define LSTAT_MAX_STAT_INDEX           4000
 
 /* 
  * Size and mask for the hash table into the directory.
@@ -164,7 +164,7 @@
 #define LSTAT_RESET      2
 #define LSTAT_RELEASE    3
 
-#define LSTAT_MAX_READ_LOCK_INDEX 100
+#define LSTAT_MAX_READ_LOCK_INDEX 1000
 typedef struct {
 #if defined(__KERNEL__) || (!defined(CONFIG_MIPS32_COMPAT) && 
!defined(CONFIG_SPARC32_COMPAT))
        rwlock_t    *lock_ptr;            /* address of lock for output stats */
<Prev in Thread] Current Thread [Next in Thread>
  • Re: Lockmeter available for 2.4.0-test9 and 2.4.0-test10, Peter Rival <=