LOCK_PROFILING confusion

From: John Polstra <jdp_at_polstra.com>
Date: Mon, 04 Dec 2006 14:56:49 -0800 (PST)
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
Received on Mon Dec 04 2006 - 21:58:51 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:03 UTC