From owner-cvs-all@FreeBSD.ORG Fri Jul 9 17:46:27 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D49F016A4CE; Fri, 9 Jul 2004 17:46:27 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id B71E743D3F; Fri, 9 Jul 2004 17:46:27 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.11/8.12.11) with ESMTP id i69HkRcc087028; Fri, 9 Jul 2004 17:46:27 GMT (envelope-from jhb@repoman.freebsd.org) Received: (from jhb@localhost) by repoman.freebsd.org (8.12.11/8.12.11/Submit) id i69HkRJS087027; Fri, 9 Jul 2004 17:46:27 GMT (envelope-from jhb) Message-Id: <200407091746.i69HkRJS087027@repoman.freebsd.org> From: John Baldwin Date: Fri, 9 Jul 2004 17:46:27 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/kern subr_witness.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jul 2004 17:46:28 -0000 jhb 2004-07-09 17:46:27 UTC FreeBSD src repository Modified files: sys/kern subr_witness.c Log: Check the lock lists to see if they are empty directly rather than assigning a pointer to the list and then dereferencing the pointer as a second step. When the first spin lock is acquired, curthread is not in a critical section so it may be preempted and would end up using another CPUs lock list instead of its own. When this code was in witness_lock() this sequence was safe as curthread was in a critical section already since witness_lock() is called after the lock is acquired. Tested by: Daniel Lang dl at leo.org Revision Changes Path 1.175 +21 -9 src/sys/kern/subr_witness.c