From owner-cvs-all@FreeBSD.ORG Mon Apr 17 19:15:07 2006 Return-Path: X-Original-To: cvs-all@freebsd.org 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 A39C216A403; Mon, 17 Apr 2006 19:15:07 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id D3DCA43D45; Mon, 17 Apr 2006 19:15:06 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k3HJF5HI077151; Mon, 17 Apr 2006 15:15:05 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: src-committers@freebsd.org Date: Mon, 17 Apr 2006 15:14:03 -0400 User-Agent: KMail/1.9.1 References: <200604171820.k3HIKcx3068404@repoman.freebsd.org> In-Reply-To: <200604171820.k3HIKcx3068404@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200604171514.06482.jhb@freebsd.org> X-Virus-Scanned: ClamAV 0.87.1/1403/Sun Apr 16 05:44:45 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: cvs-src@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/dev/hwpmc hwpmc_mod.c src/sys/dev/random randomdev_soft.c src/sys/kern kern_intr.c kern_poll.c kern_synch.c kern_thr.c kern_umtx.c sched_4bsd.c subr_taskqueue.c uipc_mqueue.c src/sys/vm vm_zeroidle.c 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, 17 Apr 2006 19:15:08 -0000 On Monday 17 April 2006 14:20, John Baldwin wrote: > jhb 2006-04-17 18:20:38 UTC > > FreeBSD src repository > > Modified files: > sys/dev/hwpmc hwpmc_mod.c > sys/dev/random randomdev_soft.c > sys/kern kern_intr.c kern_poll.c kern_synch.c > kern_thr.c kern_umtx.c sched_4bsd.c > subr_taskqueue.c uipc_mqueue.c > sys/vm vm_zeroidle.c > Log: > Change msleep() and tsleep() to not alter the calling thread's priority > if the specified priority is zero. This avoids a race where the calling > thread could read a snapshot of it's current priority, then a different > thread could change the first thread's priority, then the original thread > would call sched_prio() inside msleep() undoing the change made by the > second thread. I used a priority of zero as no thread that calls msleep() > or tsleep() should be specifying a priority of zero anyway. > > The various places that passed 'curthread->td_priority' or some variant > as the priority now pass 0. This should fix the problem where the first acpi taskq would run with a bogus priority (the sched_prio() when creating the taskqueue seemed to be ignored). -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org