Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 Dec 2006 14:56:49 -0800 (PST)
From:      John Polstra <jdp@polstra.com>
To:        current@freebsd.org
Subject:   LOCK_PROFILING confusion
Message-ID:  <XFMail.20061204145649.jdp@polstra.com>

next in thread | raw e-mail | index | archive | help
I'm having trouble making sense of the output generated by
LOCK_PROFILING -- in particular, the cnt_hold and cnt_lock stats.
The man page says:

     cnt_hold  The number of times the lock was held and another
               thread attempted to acquire the lock.

     cnt_lock  The number of times the lock was already held when this
               point was reached.

When I enable lock profiling for 30 seconds during heavy network
activity and then look at all of the lines for the sched lock, I see a
lot of non-zero values in the cnt_hold column (including several over
100000 and one over 500000).  But all of the values in the cnt_lock
column are 0.  How can that be?  It seems to me that for a given
lock, the two columns should sum to the same number -- except maybe
for recursive acquisitions, which might increase the cnt_lock numbers
without increasing the cnt_hold numbers.  (The descriptions don't say
what happens with recursive acquisitions.)

What am I missing?

John



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