From owner-cvs-src@FreeBSD.ORG Tue Jan 1 12:22:09 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 50C7516A419; Tue, 1 Jan 2008 12:22:09 +0000 (UTC) (envelope-from rrs@cisco.com) Received: from sj-iport-6.cisco.com (sj-iport-6.cisco.com [171.71.176.117]) by mx1.freebsd.org (Postfix) with ESMTP id 05A9713C461; Tue, 1 Jan 2008 12:22:08 +0000 (UTC) (envelope-from rrs@cisco.com) X-IronPort-AV: E=Sophos;i="4.24,230,1196668800"; d="scan'208";a="28810931" Received: from sj-dkim-4.cisco.com ([171.71.179.196]) by sj-iport-6.cisco.com with ESMTP; 01 Jan 2008 04:11:37 -0800 Received: from sj-core-2.cisco.com (sj-core-2.cisco.com [171.71.177.254]) by sj-dkim-4.cisco.com (8.12.11/8.12.11) with ESMTP id m01CBb0M008516; Tue, 1 Jan 2008 04:11:37 -0800 Received: from xbh-sjc-211.amer.cisco.com (xbh-sjc-211.cisco.com [171.70.151.144]) by sj-core-2.cisco.com (8.12.10/8.12.6) with ESMTP id m01CBbjC014050; Tue, 1 Jan 2008 12:11:37 GMT Received: from xfe-sjc-211.amer.cisco.com ([171.70.151.174]) by xbh-sjc-211.amer.cisco.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 1 Jan 2008 04:11:37 -0800 Received: from [127.0.0.1] ([171.68.225.134]) by xfe-sjc-211.amer.cisco.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 1 Jan 2008 04:11:36 -0800 Message-ID: <477A2D6D.9030403@cisco.com> Date: Tue, 01 Jan 2008 07:09:17 -0500 From: Randall Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.13) Gecko/20070601 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "M. Warner Losh" References: <200712311219.08286.jhb@freebsd.org> <20071231.203720.1306324107.imp@bsdimp.com> <20080101161858.A10345@delplex.bde.org> <20080101.024546.1079618522.imp@bsdimp.com> In-Reply-To: <20080101.024546.1079618522.imp@bsdimp.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 01 Jan 2008 12:11:37.0122 (UTC) FILETIME=[75300020:01C84C6F] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; l=3152; t=1199189497; x=1200053497; c=relaxed/simple; s=sjdkim4002; h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version; d=cisco.com; i=rrs@cisco.com; z=From:=20Randall=20Stewart=20 |Subject:=20Re=3A=20cvs=20commit=3A=20src/sys/netinet=20sct p_bsd_addr.c |Sender:=20; bh=cu9FqZsjZQghvSAg27zJ6p7Msdyjzk62mvAD0l3ZRGY=; b=iBmNOnXkjKd8kFs1jAWTn09vDdoK86zrUt9jni4O+qIZlDXv8N13VNazQZ bkv6/cgg+nmfTIIiGOIfXpmgZ6vhV7EklQDTdc96Srkc4GXHA2a9EQq3/xnr mAMTOzhOYC; Authentication-Results: sj-dkim-4; header.From=rrs@cisco.com; dkim=pass ( sig from cisco.com/sjdkim4002 verified; ); Cc: cvs-all@FreeBSD.org, cvs-src@FreeBSD.org, src-committers@FreeBSD.org, jhb@FreeBSD.org, brde@optusnet.com.au 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 12:22:09 -0000 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? > > : 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 > > Warner > That sure would have been nice to read in the manual page .. I would have not changed this at all if I would have had that to read :-( I was pinged on xchat over an issue where the sctp worker thread was hanging... and in the process I was told that 0 was max priority.. which really concerned me... 0 having a special meaning of.. "don't change my priority" means the old code was fine :-0 Not that having a mid-range lower priority is a bad thing for this task... R -- Randall Stewart NSSTG - Cisco Systems Inc. 803-345-0369 803-317-4952 (cell)