From owner-lockmeter@oss.sgi.com Mon Apr 3 13:35:56 2000 Received: by oss.sgi.com id ; Mon, 3 Apr 2000 13:35:46 -0700 Received: from mail.missioncriticallinux.com ([208.51.139.18]:32008 "EHLO mail.mclinux.com") by oss.sgi.com with ESMTP id ; Mon, 3 Apr 2000 13:35:29 -0700 Received: from missioncriticallinux.com (IDENT:orourke@orourke.mclinux.com [192.168.1.132]) by mail.mclinux.com (8.9.3/8.9.3) with ESMTP id PAA04353 for ; Mon, 3 Apr 2000 15:35:05 -0400 Message-ID: <38E9021B.E4B8C587@missioncriticallinux.com> Date: Mon, 03 Apr 2000 16:42:03 -0400 From: "Pat O'Rourke" Organization: MIssion Critical Linux X-Mailer: Mozilla 4.72 [en] (X11; I; Linux 2.2.14 i686) X-Accept-Language: en MIME-Version: 1.0 To: lockmeter@oss.sgi.com Subject: bug in _spin_lock_()? Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-lockmeter@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;lockmeter-outgoing I was attempting to get the lockmeter code running in 2.3.99-pre3 on a 2 cpu alpha and was encountering difficulty starting the second cpu. After some debugging I noticed _spin_lock_() did not contain a barrier() call as does the spin_unlock_wait() macro on alpha (as well as several other architectures: e.g. sparc, ppc, sparc64, ia64). The problems I was having went away when I applied the following change to kernel/lockmeter.c: --- /mnt/sbox/linux-2.3.99-pre3/kernel/lockmeter.c Fri Mar 31 13:33:18 2000 +++ linux-2.3.99-lstat/kernel/lockmeter.c Mon Apr 3 12:36:35 2000 @@ -211,7 +211,9 @@ * the bus locks. */ while (test_and_set_bit(0,lock_ptr)) { - while (test_bit(0,lock_ptr)); + do { + barrier(); + } while (test_bit(0,lock_ptr)); } lstat_update_time(lock_ptr, this_pc, LSTAT_ACT_SPIN, -- Patrick O'Rourke orourke@missioncriticallinux.com From owner-lockmeter@oss.sgi.com Mon Apr 3 15:11:46 2000 Received: by oss.sgi.com id ; Mon, 3 Apr 2000 15:11:35 -0700 Received: from pneumatic-tube.sgi.com ([204.94.214.22]:50468 "EHLO pneumatic-tube.sgi.com") by oss.sgi.com with ESMTP id ; Mon, 3 Apr 2000 15:11:21 -0700 Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by pneumatic-tube.sgi.com (980327.SGI.8.8.8-aspam/980310.SGI-aspam) via ESMTP id PAA08295 for ; Mon, 3 Apr 2000 15:15:06 -0700 (PDT) mail_from (hawkes@cthulhu.engr.sgi.com) Received: from ppphawkeswa ([169.238.112.29]) by cthulhu.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) via SMTP id PAA85832; Mon, 3 Apr 2000 15:11:02 -0700 (PDT) mail_from (hawkes@engr.sgi.com) Message-ID: <002a01bf9db9$620b94e0$1d70eea9@seattle.sgi.com> From: "John Hawkes" To: "Pat O'Rourke" , References: <38E9021B.E4B8C587@missioncriticallinux.com> Subject: Re: bug in _spin_lock_()? Date: Mon, 3 Apr 2000 15:10:11 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Sender: owner-lockmeter@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;lockmeter-outgoing From: "Pat O'Rourke" ... > I was attempting to get the lockmeter code running in 2.3.99-pre3 on a 2 cpu > alpha and was encountering difficulty starting the second cpu. After some > debugging I noticed _spin_lock_() did not contain a barrier() call as does > the spin_unlock_wait() macro on alpha (as well as several other architectures: > e.g. sparc, ppc, sparc64, ia64). ... I apologize for my inadequate treatment of non-IA32 architectures. Thanks for pointing this out. I'm about to release a patch that cuts the performance penalty of lockmetering in half (changes that were implemented by Ray Bryant at IBM). I'll incorporate your barrier() fix into that. Also, at some point in the near term I'm going to abstract the kernel/lockmeter.c bitfield manipulations and push the details down into the include/asm/spinlock.h files. I really don't want kernel/lockmeter.c to be yet another file that understands which bits get turned on and off for spinlocks and read-write locks. Thanks for your help! John Hawkes From owner-lockmeter@oss.sgi.com Thu Apr 6 07:18:24 2000 Received: by oss.sgi.com id ; Thu, 6 Apr 2000 07:18:04 -0700 Received: from pneumatic-tube.sgi.com ([204.94.214.22]:852 "EHLO pneumatic-tube.sgi.com") by oss.sgi.com with ESMTP id ; Thu, 6 Apr 2000 07:17:49 -0700 Received: from babylon.engr.sgi.com (babylon.engr.sgi.com [163.154.10.144]) by pneumatic-tube.sgi.com (980327.SGI.8.8.8-aspam/980310.SGI-aspam) via ESMTP id HAA03575 for ; Thu, 6 Apr 2000 07:21:36 -0700 (PDT) mail_from (hawkes@babylon.engr.sgi.com) Received: (from hawkes@localhost) by babylon.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) id HAA82612 for lockmeter@oss.sgi.com; Thu, 6 Apr 2000 07:16:30 -0700 (PDT) Date: Thu, 6 Apr 2000 07:16:30 -0700 (PDT) From: hawkes@babylon.engr.sgi.com (John Hawkes) Message-Id: <200004061416.HAA82612@babylon.engr.sgi.com> To: lockmeter@oss.sgi.com Subject: lockmeter 1.2.1 now available Sender: owner-lockmeter@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;lockmeter-outgoing Lockmeter 1.2.1 and the matching lockstat 1.2 are now available. They have been tested for i386 and are believed to compile and work also for Alpha, but definitive Alpha testing is still pending. The heart of the lockmeter 1.2.1 changes are contributed by Ray Bryant at IBM (raybry@us.ibm.com) and reduce the performance impact of "hold time" metering by about half. Accordingly, lockmeter/lockstat now does not treat "hold" metering as a special costlier option. When you turn on metering, you get both. I am going on vacation until April 14 and will be unable to respond to email during my absence. I hope that this mailing list will be used to communicate any problems that arise, and I apologize in advance for causing those problems. After I return from vacation I plan to implement lockmetering in the IA64. -- John Hawkes From owner-lockmeter@oss.sgi.com Fri Apr 7 10:55:27 2000 Received: by oss.sgi.com id ; Fri, 7 Apr 2000 10:55:17 -0700 Received: from mail.missioncriticallinux.com ([208.51.139.18]:29458 "EHLO mail.mclinux.com") by oss.sgi.com with ESMTP id ; Fri, 7 Apr 2000 10:55:04 -0700 Received: from missioncriticallinux.com (IDENT:orourke@orourke.mclinux.com [192.168.1.132]) by mail.mclinux.com (8.9.3/8.9.3) with ESMTP id NAA20283 for ; Fri, 7 Apr 2000 13:54:57 -0400 Message-ID: <38EE2275.DE7A4A88@missioncriticallinux.com> Date: Fri, 07 Apr 2000 14:01:25 -0400 From: "Pat O'Rourke" Organization: MIssion Critical Linux X-Mailer: Mozilla 4.72 [en] (X11; I; Linux 2.2.14 i686) X-Accept-Language: en MIME-Version: 1.0 To: lockmeter@oss.sgi.com Subject: [PATCH] incorrect logic in release_control_space() Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-lockmeter@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;lockmeter-outgoing I believe the logic in release_control_space is reversed and should be as follows: diff -Nru 1.1/kernel/lockmeter.c 1.2/kernel/lockmeter.c --- 1.1/kernel/lockmeter.c Thu Apr 6 18:22:50 2000 +++ 1.2/kernel/lockmeter.c Fri Apr 7 13:54:26 2000 @@ -315,12 +315,12 @@ */ int cpu; - if (!lstat_control.hashtab) { + if (lstat_control.hashtab) { kfree(lstat_control.hashtab); lstat_control.hashtab = NULL; } - if (!lstat_control.dir) { + if (lstat_control.dir) { kfree(lstat_control.dir); lstat_control.dir = NULL; } -- Patrick O'Rourke orourke@missioncriticallinux.com From owner-lockmeter@oss.sgi.com Fri Apr 14 06:37:48 2000 Received: by oss.sgi.com id ; Fri, 14 Apr 2000 06:37:39 -0700 Received: from mail.missioncriticallinux.com ([208.51.139.18]:5895 "EHLO mail.mclinux.com") by oss.sgi.com with ESMTP id ; Fri, 14 Apr 2000 06:37:29 -0700 Received: from missioncriticallinux.com (IDENT:orourke@orourke.mclinux.com [192.168.1.132]) by mail.mclinux.com (8.9.3/8.9.3) with ESMTP id JAA01107 for ; Fri, 14 Apr 2000 09:37:00 -0400 Message-ID: <38F71EF0.DDFDD1BF@missioncriticallinux.com> Date: Fri, 14 Apr 2000 09:36:48 -0400 From: "Pat O'Rourke" Organization: MIssion Critical Linux X-Mailer: Mozilla 4.72 [en] (X11; I; Linux 2.3.99-pre3 i686) X-Accept-Language: en MIME-Version: 1.0 To: lockmeter Subject: io_remap_page_range macro Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-lockmeter@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;lockmeter-outgoing The lockmetering patch changes the virt_to_phys() call in the alpha version of the io_remap_page_range macro (see include/asm-alpha/pgtable.h) to take a second argument, but as far as I can tell, virt_to_phys() only accepts a single argument. So is this a bug, or am I missing something? It appears to me that there is no reason for lockmetering to change pgtable.h for alpha. Thanks, Pat -- Patrick O'Rourke orourke@missioncriticallinux.com