Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 May 2003 17:31:54 -0700
From:      Bakul Shah <bakul@bitblocks.com>
To:        "Poul-Henning Kamp" <phk@phk.freebsd.dk>
Cc:        "M. Warner Losh" <imp@bsdimp.com>
Subject:   Re: Interrupt latency problems 
Message-ID:  <200305120031.h4C0VsPF029532@bitblocks.com>
In-Reply-To: Your message of "Mon, 12 May 2003 01:06:19 %2B0200." <2905.1052694379@critter.freebsd.dk> 

next in thread | previous in thread | raw e-mail | index | archive | help
> >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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305120031.h4C0VsPF029532>