From jgutie11@eafit.edu.co  Mon Nov 22 05:43:15 2004
Return-Path: <jgutie11@eafit.edu.co>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 36B6D16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 22 Nov 2004 05:43:15 +0000 (GMT)
Received: from escargot.epm.net.co (escargot.epm.net.co [200.13.224.6])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4DA4143D5F
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 22 Nov 2004 05:43:14 +0000 (GMT)
	(envelope-from jgutie11@eafit.edu.co)
Received: from uma (uma.epm.net.co [200.13.224.10])
	by escargot.epm.net.co (Postfix) with ESMTP id F2051BCD4
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 22 Nov 2004 00:43:12 -0500 (COT)
Received: from _HOSTNAME_ ([200.116.30.165])
 by smtpmed.epm.net.co (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19
 2003)) with ESMTPA id <0I7K00C9FFVVAC@smtpmed.epm.net.co> for
 FreeBSD-gnats-submit@freebsd.org; Mon, 22 Nov 2004 00:43:12 -0500 (COT)
Received: by _HOSTNAME_ (sSMTP sendmail emulation); Mon,
 22 Nov 2004 00:43:04 -0500
Message-Id: <0I7K00CB4FW0AC@smtpmed.epm.net.co>
Date: Mon, 22 Nov 2004 00:43:04 -0500
From: "Jorge Mario G. Mazo" <jgutie11@eafit.edu.co>
Sender: teresitamp@epm.net.co
Reply-To: "Jorge Mario G. Mazo" <jgutie11@eafit.edu.co>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: renice odd behavior
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         74227
>Category:       bin
>Synopsis:       renice odd behavior
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Nov 22 05:50:31 GMT 2004
>Closed-Date:    Mon Nov 22 21:16:43 GMT 2004
>Last-Modified:  Mon Nov 22 21:16:43 GMT 2004
>Originator:     Jorge Mario G. Mazo
>Release:        FreeBSD 5.3-STABLE i386
>Organization:
>Environment:
System: FreeBSD mosca.linopryne.com 5.3-STABLE FreeBSD 5.3-STABLE #0: Wed Nov 10 13:25:53 UTC 2004 root@mosca.linopryne.com:/usr/obj/usr/src/sys/SALMONELA i386


	
>Description:
	When you renice a proces to 20 and the you renice it to -20
	it wont jump from 20 to -20. it'll jump from 20 to 0
	so you have to renice it again to actually get the -20 value
	*Same thing happens backwards (-20 to 20)
	
>How-To-Repeat:
	"I started from a -20 value"
	
	CASE1:
		-su-2.05b# renice -n 20 -p 426
		426: old priority -20, new priority 0
		-su-2.05b# renice -n 20 -p 426
		426: old priority 0, new priority 20
		-su-2.05b#
	CASE2:
		-su-2.05b# renice -n -20 -p 426
		426: old priority 20, new priority 0
		-su-2.05b# renice -n -20 -p 426
		426: old priority 0, new priority -20
		-su-2.05b#

	
>Fix:

	


>Release-Note:
>Audit-Trail:

From: Gleb Smirnoff <glebius@freebsd.org>
To: "Jorge Mario G. Mazo" <jgutie11@eafit.edu.co>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/74227: renice odd behavior
Date: Mon, 22 Nov 2004 11:59:11 +0300

 What scheduler do you use ULE or 4BSD?
 
 -- 
 Totus tuus, Glebius.
 GLEBIUS-RIPN GLEB-RIPE

From: Robert Watson <rwatson@FreeBSD.org>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/74227: renice odd behavior
Date: Mon, 22 Nov 2004 11:26:01 +0000 (GMT)

 robert@fledge.watson.org      Principal Research Scientist, McAfee Research
 
 On Mon, 22 Nov 2004, Jorge Mario G. Mazo wrote:
 
 > >Description:
 > 	When you renice a proces to 20 and the you renice it to -20
 > 	it wont jump from 20 to -20. it'll jump from 20 to 0
 > 	so you have to renice it again to actually get the -20 value
 > 	*Same thing happens backwards (-20 to 20)
 
 Isn't this the documented behavior of -n in renice(8):
 
      -n      Instead of changing the specified processes to the given prior-
              ity, interpret the following argument as an increment to be
              applied to the current priority of each process.
 
 Does renice work as desired if you omit the "-n" from the command line?
 
 Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
 robert@fledge.watson.org      Principal Research Scientist, McAfee Research
 
State-Changed-From-To: open->closed 
State-Changed-By: billf 
State-Changed-When: Mon Nov 22 21:16:09 GMT 2004 
State-Changed-Why:  
as rwatson points out, this is the documented behavior for -n. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=74227 
>Unformatted:
