Date: Mon, 1 Apr 2002 10:58:04 +0930 From: Greg 'groggy' Lehey <grog@FreeBSD.org> To: Dag-Erling Smorgrav <des@ofug.org> Cc: arch@freebsd.org Subject: Re: mutex profiling Message-ID: <20020401105804.B26813@wantadilla.lemis.com> In-Reply-To: <xzp8z88e6i1.fsf@flood.ping.uio.no> References: <xzp8z88e6i1.fsf@flood.ping.uio.no>
next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, 1 April 2002 at 0:07:18 +0200, Dag-Erling Smorgrav wrote: > The attached patch (derived from patches by Eivind) adds code to > record statistics about MTX_DEF locks. It's currently i386-only as it > uses the TSC to measure the amount of time each mutex is held. Once > compiled in and enabled, statistics can be retrieved using sysctl(8). > The code records four numbers for each mutex (longest time held in one > go, total time held, number of acquisitions, average time held) and > returns a top-16 list for each. Each mutex is identified by the place > where it was first acquired, so multiple instances of the same type of > mutex (e.g. proc lock, filedesc lock) are counted as one. Here's a > sample listing (with some annotations): Excellent! Of course, it could be better :-) It would be nice to get a list by lock of each of the four parameters, something like: max total count average i386/i386/machdep.c:1715 10653798 5472784414 1127992 4852 (repeat for each lock) One of the things that I can't recall anybody looking at has been whether to spin or block on each kind of lock. This information would help make that decision. What units are the times in? If the average time spent in Giant is 4852 µs, I'd say it's definitely a waste of time to spin on it at all. If it's 4852 ns, it's probably the correct thing to do. Greg -- See complete headers for address and phone numbers To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020401105804.B26813>