From owner-svn-src-head@FreeBSD.ORG Wed May 30 21:02:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EDD4B1065673; Wed, 30 May 2012 21:02:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF5CF8FC1B; Wed, 30 May 2012 21:02:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q4UL2CBt076868; Wed, 30 May 2012 21:02:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q4UL2CO8076866; Wed, 30 May 2012 21:02:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201205302102.q4UL2CO8076866@svn.freebsd.org> From: John Baldwin Date: Wed, 30 May 2012 21:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236334 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 May 2012 21:02:13 -0000 Author: jhb Date: Wed May 30 21:02:12 2012 New Revision: 236334 URL: http://svn.freebsd.org/changeset/base/236334 Log: - Witness doesn't verify the old MTX_NOSWITCH flag's correctness (that was obsoleted when critical sections were added). Instead, list a check that witness does perform. - Note that 'show locks' in DDB takes an optional thread argument. - Document 'show all locks'. - Remove the BUGS section, the bug in question was fixed 11 years ago in r76272. Modified: head/share/man/man4/witness.4 Modified: head/share/man/man4/witness.4 ============================================================================== --- head/share/man/man4/witness.4 Wed May 30 21:01:06 2012 (r236333) +++ head/share/man/man4/witness.4 Wed May 30 21:02:12 2012 (r236334) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 18, 2001 +.Dd May 30, 2012 .Dt WITNESS 4 .Os .Sh NAME @@ -52,11 +52,8 @@ violation occurs. The .Nm code also checks various other conditions such as verifying that one -does not recurse on a non-recursive lock. -For sleep locks, -.Nm -verifies that a new process would not be switched to when a lock is released -or a lock is blocked on during an acquire while any spin locks are held. +does not recurse on a non-recursive lock, +or attempt an upgrade on a shared lock held by another thread. If any of these checks fail, then the kernel will panic. .Pp The flag that controls whether or not the kernel debugger is entered when a @@ -97,7 +94,7 @@ specifies the level of witness involveme A value of 1 specifies that witness is enabled. A value of 0 specifies that witness is disabled, but that can be enabled again. This will maintain a small amount of overhead in the system. -A value of -1 specifies that witness is disabled permanently and that +A value of -1 specifies that witness is disabled permanently and cannot be enabled again. The sysctl .Va debug.witness.watch @@ -114,10 +111,22 @@ and .Xr ddb 4 are compiled into the kernel: .Bl -ohang -.It Ic show locks -Outputs the list of locks held by the current thread to the kernel console +.It Ic show locks Op thread +Outputs the list of locks held by a thread to the kernel console along with the filename and line number at which each lock was last acquired -by this thread. +by the thread. +The optional +.Ar thread +argument may be either a TID, +PID, +or pointer to a thread structure. +If +.Ar thread +is not specified, +then the locks held by the current thread are displayed. +.It Ic show all locks +Outputs the list of locks held by all threads in the system to the +kernel console. .It Ic show witness Dump the current order list to the kernel console. The code first displays the lock order tree for all of the sleep locks. @@ -136,9 +145,3 @@ code first appeared in .Bsx 5.0 and was imported from there into .Fx 5.0 . -.Sh BUGS -The -.Nm -code currently does not handle recursion of shared -.Xr sx 9 -locks properly.