From owner-freebsd-current@FreeBSD.ORG Fri Feb 27 11:00:26 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 584A116A4CF for ; Fri, 27 Feb 2004 11:00:26 -0800 (PST) Received: from mail4.speakeasy.net (mail4.speakeasy.net [216.254.0.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 34D9743D41 for ; Fri, 27 Feb 2004 11:00:26 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 30176 invoked from network); 27 Feb 2004 19:00:25 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 27 Feb 2004 19:00:25 -0000 Received: from 10.50.40.205 (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.10/8.12.10) with ESMTP id i1RJ0728057784; Fri, 27 Feb 2004 14:00:08 -0500 (EST) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: current@FreeBSD.org Date: Fri, 27 Feb 2004 14:01:30 -0500 User-Agent: KMail/1.6 References: <200402271852.i1RIqib4030393@repoman.freebsd.org> In-Reply-To: <200402271852.i1RIqib4030393@repoman.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200402271401.30950.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: alc@FreeBSD.org Subject: HEADSUP: Sleep queues added to kernel, so be careful. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Feb 2004 19:00:26 -0000 On Friday 27 February 2004 01:52 pm, John Baldwin wrote: > 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: There should be little user-visible effect from this change. Under load one can trigger a new diagnostic message (soon to become an assertion, but it's a diagnostic for now) about mismatches of msleep() wait channels and lock pointers. The one case I have seen is that vm_page_sleep_if_busy() triggers a diagnostic as it sleeps on a vm_page * while holding the page queues mutex but some other thread is already sleeping on that address while holding no lock (implicitly using Giant for synchronization). If you do get any weird crashes, be sure to turn on INVARIANTS and WITNESS (with spin mutex checking on, i.e. no WITNESS_SKIPSPIN) to see if you can get a less obscure panic message. All of the bugs I found during testing were found by INVARIANTS + WITNESS and when found in that manner they are a lot easier to locate and fix. Thanks. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org