From owner-freebsd-current@FreeBSD.ORG Sun May 11 17:31:57 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6A7C737B401 for ; Sun, 11 May 2003 17:31:57 -0700 (PDT) Received: from bitblocks.com (bitblocks.com [209.204.185.216]) by mx1.FreeBSD.org (Postfix) with ESMTP id 78C7E43FBD for ; Sun, 11 May 2003 17:31:56 -0700 (PDT) (envelope-from bakul@bitblocks.com) Received: from bitblocks.com (localhost [127.0.0.1]) by bitblocks.com (8.12.9/8.12.9) with ESMTP id h4C0VsPF029532; Sun, 11 May 2003 17:31:54 -0700 (PDT) (envelope-from bakul@bitblocks.com) Message-Id: <200305120031.h4C0VsPF029532@bitblocks.com> To: "Poul-Henning Kamp" In-reply-to: Your message of "Mon, 12 May 2003 01:06:19 +0200." <2905.1052694379@critter.freebsd.dk> Date: Sun, 11 May 2003 17:31:54 -0700 From: Bakul Shah cc: current@freebsd.org cc: "M. Warner Losh" Subject: Re: Interrupt latency problems X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2003 00:31:57 -0000 > >Is it possible to cheaply check how long a mutex was held? > > Have WITNESS store a timestamp when mutex is grabbed. Check delta-T > when mutes is releases. Whine if above ? Yeah, something like it! I was thinking of this more as a way to find (and fix!) slow uses -- logging this is probably not of much use as a user can't do anything about it (except you have more user complaints!). Mutex holdtime distribution seems more useful: if only a few uses have long holdtimes they should be looked at first. If most uses are long, time to sit back and figure out something better. If a mutex is released in only a few machine cycles, may be a spinlock is better.... If the distribution suddenly changes for the worse from version N to version N+1 of the kernel you don't have to wait until someone complains to know something broke and you know where to look. I'd use a different define from WITNESS.