From owner-lockmeter@oss.sgi.com Thu Dec 14 04:24:40 2000 Received: by oss.sgi.com id ; Thu, 14 Dec 2000 04:24:29 -0800 Received: from zmamail02.zma.compaq.com ([161.114.64.102]:28164 "HELO zmamail02.zma.compaq.com") by oss.sgi.com with SMTP id ; Thu, 14 Dec 2000 04:24:10 -0800 Received: by zmamail02.zma.compaq.com (Postfix, from userid 12345) id CFF9754DE; Thu, 14 Dec 2000 07:24:04 -0500 (EST) Received: from anw.zk3.dec.com (alpha.zk3.dec.com [16.140.128.4]) by zmamail02.zma.compaq.com (Postfix) with ESMTP id 790A658FA; Thu, 14 Dec 2000 07:24:04 -0500 (EST) Received: from zk3.dec.com by anw.zk3.dec.com (8.9.3/1.1.22.2/08Sep98-0251PM) id HAA0001055090; Thu, 14 Dec 2000 07:24:00 -0500 (EST) Message-ID: <3A38BBF7.5090700@zk3.dec.com> Date: Thu, 14 Dec 2000 07:24:23 -0500 From: Peter Rival Organization: Tru64 QMG Performance Engineering User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-22smp i686; en-US; m18) Gecko/20001107 Netscape6/6.0 X-Accept-Language: en MIME-Version: 1.0 To: John Hawkes Cc: lockmeter@oss.sgi.com Subject: Re: Lockmeter available for 2.4.0-test9 and 2.4.0-test10 References: <046d01c04b61$bca64ca0$6501a8c0@marin1.sfba.home.com> Content-Type: multipart/mixed; boundary="------------070402030900070800020105" Sender: owner-lockmeter@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;lockmeter-outgoing This is a multi-part message in MIME format. --------------070402030900070800020105 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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@engr.sgi.com > http://www.sgi.com/developers/oss/ > > --------------070402030900070800020105 Content-Type: text/plain; name="alpha-lockmeter-diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="alpha-lockmeter-diffs" 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 */ --------------070402030900070800020105--