From owner-freebsd-current@FreeBSD.ORG Mon Dec 4 22:58:51 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5408216A90A for ; Mon, 4 Dec 2006 22:58:50 +0000 (UTC) (envelope-from jdp@polstra.com) Received: from blake.polstra.com (blake.polstra.com [64.81.189.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9760C43CA5 for ; Mon, 4 Dec 2006 22:56:14 +0000 (GMT) (envelope-from jdp@polstra.com) Received: from strings.polstra.com (strings.polstra.com [64.81.189.67]) by blake.polstra.com (8.13.8/8.13.8) with ESMTP id kB4MunJK027658 for ; Mon, 4 Dec 2006 14:56:49 -0800 (PST) (envelope-from jdp@polstra.com) Message-ID: X-Mailer: XFMail 1.5.5 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Date: Mon, 04 Dec 2006 14:56:49 -0800 (PST) From: John Polstra To: current@freebsd.org Cc: Subject: LOCK_PROFILING confusion X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 04 Dec 2006 22:58:52 -0000 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