From owner-freebsd-current@FreeBSD.ORG Sun May 11 16:06:33 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 84AF337B401 for ; Sun, 11 May 2003 16:06:33 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8A89143FEA for ; Sun, 11 May 2003 16:06:32 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h4BN6JYP002906; Mon, 12 May 2003 01:06:20 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: Bakul Shah From: "Poul-Henning Kamp" In-Reply-To: Your message of "Sun, 11 May 2003 15:58:32 PDT." <200305112258.h4BMwWPF029180@bitblocks.com> Date: Mon, 12 May 2003 01:06:19 +0200 Message-ID: <2905.1052694379@critter.freebsd.dk> 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: Sun, 11 May 2003 23:06:33 -0000 In message <200305112258.h4BMwWPF029180@bitblocks.com>, Bakul Shah writes: >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 ? We already have a similar check for timeout functions, the policy I opted for there was to only whine if the duration was longer than the previous higest duration. Output looks like: Expensive timeout(9) function: 0xc03d01f0(0) 0.003696815 s This should be simple to implement for mutex'es too. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.