From owner-cvs-src@FreeBSD.ORG Mon Jun 4 23:50:32 2007 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 49DB216A421; Mon, 4 Jun 2007 23:50:32 +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 3B2BD13C45E; Mon, 4 Jun 2007 23:50:32 +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 l54NoWeJ073739; Mon, 4 Jun 2007 23:50:32 GMT (envelope-from jeff@repoman.freebsd.org) Received: (from jeff@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l54NoWcD073738; Mon, 4 Jun 2007 23:50:32 GMT (envelope-from jeff) Message-Id: <200706042350.l54NoWcD073738@repoman.freebsd.org> From: Jeff Roberson Date: Mon, 4 Jun 2007 23:50:31 +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_switch.c sched_4bsd.c sched_core.c sched_ule.c src/sys/sys mutex.h proc.h sched.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Jun 2007 23:50:32 -0000 jeff 2007-06-04 23:50:31 UTC FreeBSD src repository Modified files: sys/kern sched_4bsd.c sched_core.c sched_ule.c kern_switch.c sys/sys mutex.h proc.h sched.h Log: Commit 1/14 of sched_lock decomposition. - Move all scheduler locking into the schedulers utilizing a technique similar to solaris's container locking. - A per-process spinlock is now used to protect the queue of threads, thread count, suspension count, p_sflags, and other process related scheduling fields. - The new thread lock is actually a pointer to a spinlock for the container that the thread is currently owned by. The container may be a turnstile, sleepqueue, or run queue. - thread_lock() is now used to protect access to thread related scheduling fields. thread_unlock() unlocks the lock and thread_set_lock() implements the transition from one lock to another. - A new "blocked_lock" is used in cases where it is not safe to hold the actual thread's lock yet we must prevent access to the thread. - sched_throw() and sched_fork_exit() are introduced to allow the schedulers to fix-up locking at these points. - Add some minor infrastructure for optionally exporting scheduler statistics that were invaluable in solving performance problems with this patch. Generally these statistics allow you to differentiate between different causes of context switches. 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.130 +71 -21 src/sys/kern/kern_switch.c 1.98 +115 -45 src/sys/kern/sched_4bsd.c 1.14 +57 -2 src/sys/kern/sched_core.c 1.193 +136 -39 src/sys/kern/sched_ule.c 1.96 +9 -0 src/sys/sys/mutex.h 1.479 +57 -56 src/sys/sys/proc.h 1.32 +15 -1 src/sys/sys/sched.h