From owner-cvs-all Thu Jun 6 12: 4:43 2002 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id C6CE737B403; Thu, 6 Jun 2002 12:04:38 -0700 (PDT) Received: (from jhb@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g56J4cw03179; Thu, 6 Jun 2002 12:04:38 -0700 (PDT) (envelope-from jhb) Message-Id: <200206061904.g56J4cw03179@freefall.freebsd.org> From: John Baldwin Date: Thu, 6 Jun 2002 12:04:38 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern subr_witness.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG jhb 2002/06/06 12:04:38 PDT Modified files: sys/kern subr_witness.c Log: Handle "dead" witnesses better in the situation of several short term locks being created and destroyed without a single long-term one around to ensure the witness associated with that group of locks stays alive. The pipe mutexes are an example of this group. For a dead witness we no longer clear the witness name. Instead, when looking up the witness for a lock, if a dead witness' (a witness with a refcount of 0) w_name pointer is identical to the witness name of the lock then we revive that witness instead of using a new witness for the lock. This results in far fewer dead witness objects and also better preserves locking orders over the long term resulting in more correct lock order checking. Note that we can't ever derefence w_name of a dead witness since we don't know if the string it is pointing to has been free()'d or kldunload()'d out from under us. Revision Changes Path 1.117 +11 -13 src/sys/kern/subr_witness.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message