From owner-cvs-src@FreeBSD.ORG Tue Jan 1 05:37:31 2008 Return-Path: Delivered-To: cvs-src@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B122416A417; Tue, 1 Jan 2008 05:37:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail14.syd.optusnet.com.au (mail14.syd.optusnet.com.au [211.29.132.195]) by mx1.freebsd.org (Postfix) with ESMTP id 486C113C442; Tue, 1 Jan 2008 05:37:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-219-213.carlnfd3.nsw.optusnet.com.au (c211-30-219-213.carlnfd3.nsw.optusnet.com.au [211.30.219.213]) by mail14.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m015bMQM006194 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 1 Jan 2008 16:37:24 +1100 Date: Tue, 1 Jan 2008 16:37:22 +1100 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: "M. Warner Losh" In-Reply-To: <20071231.203720.1306324107.imp@bsdimp.com> Message-ID: <20080101161858.A10345@delplex.bde.org> References: <200712291507.lBTF7sTA069010@repoman.freebsd.org> <200712311219.08286.jhb@freebsd.org> <20071231.203720.1306324107.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: rrs@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org, jhb@FreeBSD.org, cvs-src@FreeBSD.org Subject: Re: cvs commit: src/sys/netinet sctp_bsd_addr.c 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: Tue, 01 Jan 2008 05:37:31 -0000 On Mon, 31 Dec 2007, M. Warner Losh wrote: > In message: <200712311219.08286.jhb@freebsd.org> > John Baldwin writes: > : The more correct fix though is to do a 'sched_prio()' at the start of the > : thread's main loop to set the priority and then not adjust it via msleep(). > : Kernel threads really should never pass a priority to msleep() but always '0' > : (which means "don't change my priority"). > > Not PZERO? When should one use PZERO and when should one use a bare > '0'? Can this information be added to the man page? PZERO is compatibility cruft which should never be used. Just a few places in kern still use it to invent a priority when no suitable priority (like PSOCK or PRIBIO) is already #defined. It isn't clear where these invented priorities are suitable. Otherwise, PZERO has a completely different meaning from either priority 0 (maximal) or the bare 0 arg to msleep. It means some middle priority, or the bias from priority 0 to get to that middle priority, so that after subtracting it, 0 becomes the middle priority. The bare 0 is actualy priority 0 (maximal) overloaded to mean "don't change the priority". This overloading doesn't lose anything except clarity since nothing is permitted to wake up at maximal priority after a sleep. (Maximal priority is reserved for realtime priority ithreads and even much lower priority ithreads are not permitted to sleep, and non-interrupt threads aren't permitted to run at ithread priorities except temporarily for priority propagation.) Bruce