From owner-cvs-src@FreeBSD.ORG Wed Jan 2 18:05:08 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 BDD1516A41A; Wed, 2 Jan 2008 18:05:08 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id 3AEF313C459; Wed, 2 Jan 2008 18:05:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8q) with ESMTP id 227032743-1834499 for multiple; Wed, 02 Jan 2008 13:02:53 -0500 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id m02I4kCi018326; Wed, 2 Jan 2008 13:04:46 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: "M. Warner Losh" Date: Wed, 2 Jan 2008 12:17:21 -0500 User-Agent: KMail/1.9.6 References: <200712311219.08286.jhb@freebsd.org> <20080101161858.A10345@delplex.bde.org> <20080101.024546.1079618522.imp@bsdimp.com> In-Reply-To: <20080101.024546.1079618522.imp@bsdimp.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801021217.22195.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 02 Jan 2008 13:04:47 -0500 (EST) X-Virus-Scanned: ClamAV 0.91.2/5343/Wed Jan 2 12:41:01 2008 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: rrs@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org, brde@optusnet.com.au, 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: Wed, 02 Jan 2008 18:05:08 -0000 On Tuesday 01 January 2008 04:45:46 am M. Warner Losh wrote: > In message: <20080101161858.A10345@delplex.bde.org> > Bruce Evans writes: > : 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. > > Do we want to document the other Pxxxx priorities? Also, PZERO is meant to be a base for userland priorities (threads in userland should be <= PZERO except for real time threads) and is an actual priority value. 0 means "don't change anything." > : 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.) > > So would the following be a reasonable change to sleep.9? > > Index: sleep.9 > =================================================================== > RCS file: /home/ncvs/src/share/man/man9/sleep.9,v > retrieving revision 1.61 > diff -u -r1.61 sleep.9 > --- sleep.9 30 Mar 2007 18:07:26 -0000 1.61 > +++ sleep.9 1 Jan 2008 09:44:01 -0000 > @@ -93,6 +93,10 @@ > runnable with the specified > .Fa priority > when it resumes. > +.Dv PZERO > +should never be used, as it is for compatibility only. > +A new priority of 0 means to use the thread's current priority when > +it is made runnable again. > If > .Fa priority > includes the The manpage already says that priority 0 doesn't change the priority (look at the first half of the sentence before your new one). I'm not sure PZERO deserves special mention. You could perhaps add a new section after 'DESCRIPTION' that covers the various Pxxx priorities that are often used for *sleep() routines such as PZERO, PSOCK, PVM, etc. -- John Baldwin