From owner-cvs-all@FreeBSD.ORG Mon Jun 4 23:51:44 2007 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D01C516A41F; Mon, 4 Jun 2007 23:51:44 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id C1D0113C483; Mon, 4 Jun 2007 23:51:44 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l54Npi3u074537; Mon, 4 Jun 2007 23:51:44 GMT (envelope-from jeff@repoman.freebsd.org) Received: (from jeff@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l54Npid4074536; Mon, 4 Jun 2007 23:51:44 GMT (envelope-from jeff) Message-Id: <200706042351.l54Npid4074536@repoman.freebsd.org> From: Jeff Roberson Date: Mon, 4 Jun 2007 23:51:44 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/kern kern_mutex.c kern_rwlock.c subr_turnstile.c src/sys/sys turnstile.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 04 Jun 2007 23:51:44 -0000 jeff 2007-06-04 23:51:44 UTC FreeBSD src repository Modified files: sys/kern kern_mutex.c kern_rwlock.c subr_turnstile.c sys/sys turnstile.h Log: Commit 3/14 of sched_lock decomposition. - Add a per-turnstile spinlock to solve potential priority propagation deadlocks that are possible with thread_lock(). - The turnstile lock order is defined as the exact opposite of the lock order used with the sleep locks they represent. This allows us to walk in reverse order in priority_propagate and this is the only place we wish to multiply acquire turnstile locks. - Use the turnstile_chain lock to protect assigning mutexes to turnstiles. - Change the turnstile interface to pass back turnstile pointers to the consumers. This allows us to reduce some locking and makes it easier to cancel turnstile assignment while the turnstile chain lock is held. Tested by: kris, current@ Tested on: i386, amd64, ULE, 4BSD, libthr, libkse, PREEMPTION, etc. Discussed with: kris, attilio, kmacy, jhb, julian, bde (small parts each) Revision Changes Path 1.191 +122 -27 src/sys/kern/kern_mutex.c 1.26 +28 -26 src/sys/kern/kern_rwlock.c 1.168 +149 -135 src/sys/kern/subr_turnstile.c 1.12 +6 -4 src/sys/sys/turnstile.h