From owner-cvs-src@FreeBSD.ORG Fri Feb 27 10:52:44 2004 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EA08A16A4CE; Fri, 27 Feb 2004 10:52:44 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CCED943D2D; Fri, 27 Feb 2004 10:52:44 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id i1RIqiGe030394; Fri, 27 Feb 2004 10:52:44 -0800 (PST) (envelope-from jhb@repoman.freebsd.org) Received: (from jhb@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id i1RIqib4030393; Fri, 27 Feb 2004 10:52:44 -0800 (PST) (envelope-from jhb) Message-Id: <200402271852.i1RIqib4030393@repoman.freebsd.org> From: John Baldwin Date: Fri, 27 Feb 2004 10:52:44 -0800 (PST) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/conf files src/sys/ddb db_ps.c src/sys/kern kern_condvar.c kern_sig.c kern_synch.c kern_thread.c sched_4bsd.c sched_ule.c sys_generic.c vfs_subr.c src/sys/sys condvar.h proc.h sched.h systm.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 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: Fri, 27 Feb 2004 18:52:45 -0000 jhb 2004/02/27 10:52:44 PST FreeBSD src repository Modified files: sys/conf files sys/ddb db_ps.c sys/kern kern_condvar.c kern_sig.c kern_synch.c kern_thread.c sched_4bsd.c sched_ule.c sys_generic.c vfs_subr.c sys/sys condvar.h proc.h sched.h systm.h Log: Switch the sleep/wakeup and condition variable implementations to use the sleep queue interface: - Sleep queues attempt to merge some of the benefits of both sleep queues and condition variables. Having sleep qeueus in a hash table avoids having to allocate a queue head for each wait channel. Thus, struct cv has shrunk down to just a single char * pointer now. However, the hash table does not hold threads directly, but queue heads. This means that once you have located a queue in the hash bucket, you no longer have to walk the rest of the hash chain looking for threads. Instead, you have a list of all the threads sleeping on that wait channel. - Outside of the sleepq code and the sleep/cv code the kernel no longer differentiates between cv's and sleep/wakeup. For example, calls to abortsleep() and cv_abort() are replaced with a call to sleepq_abort(). Thus, the TDF_CVWAITQ flag is removed. Also, calls to unsleep() and cv_waitq_remove() have been replaced with calls to sleepq_remove(). - The sched_sleep() function no longer accepts a priority argument as sleep's no longer inherently bump the priority. Instead, this is soley a propery of msleep() which explicitly calls sched_prio() before blocking. - The TDF_ONSLEEPQ flag has been dropped as it was never used. The associated TDF_SET_ONSLEEPQ and TDF_CLR_ON_SLEEPQ macros have also been dropped and replaced with a single explicit clearing of td_wchan. TD_SET_ONSLEEPQ() would really have only made sense if it had taken the wait channel and message as arguments anyway. Now that that only happens in one place, a macro would be overkill. Revision Changes Path 1.866 +1 -0 src/sys/conf/files 1.50 +2 -16 src/sys/ddb/db_ps.c 1.46 +46 -295 src/sys/kern/kern_condvar.c 1.271 +7 -16 src/sys/kern/kern_sig.c 1.243 +81 -217 src/sys/kern/kern_synch.c 1.171 +7 -11 src/sys/kern/kern_thread.c 1.34 +2 -2 src/sys/kern/sched_4bsd.c 1.100 +2 -2 src/sys/kern/sched_ule.c 1.129 +3 -8 src/sys/kern/sys_generic.c 1.484 +2 -7 src/sys/kern/vfs_subr.c 1.10 +0 -9 src/sys/sys/condvar.h 1.369 +2 -7 src/sys/sys/proc.h 1.11 +1 -1 src/sys/sys/sched.h 1.204 +0 -1 src/sys/sys/systm.h