From owner-freebsd-bugs@FreeBSD.ORG Tue Nov 25 08:40:05 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1CA41065675 for ; Tue, 25 Nov 2008 08:40:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A9DDC8FC17 for ; Tue, 25 Nov 2008 08:40:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id mAP8e5rQ041533 for ; Tue, 25 Nov 2008 08:40:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id mAP8e5Qb041532; Tue, 25 Nov 2008 08:40:05 GMT (envelope-from gnats) Resent-Date: Tue, 25 Nov 2008 08:40:05 GMT Resent-Message-Id: <200811250840.mAP8e5Qb041532@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Unga Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4285A106564A for ; Tue, 25 Nov 2008 08:31:07 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 300CB8FC12 for ; Tue, 25 Nov 2008 08:31:07 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id mAP8V7JS064025 for ; Tue, 25 Nov 2008 08:31:07 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id mAP8V6cP064024; Tue, 25 Nov 2008 08:31:06 GMT (envelope-from nobody) Message-Id: <200811250831.mAP8V6cP064024@www.freebsd.org> Date: Tue, 25 Nov 2008 08:31:06 GMT From: Unga To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: kern/129164: Wrong priority value for normal processes X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Nov 2008 08:40:05 -0000 >Number: 129164 >Category: kern >Synopsis: Wrong priority value for normal processes >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Nov 25 08:40:05 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Unga >Release: FreeBSD 7.0-STABLE >Organization: >Environment: FreeBSD grey.lan 7.0-STABLE FreeBSD 7.0-STABLE Sun May 25 2008 i386 >Description: The priority value for root and other normal processes is 65504 (rtp.prio) where zero (0) is expected. I checked the program flow from /usr/src/usr.bin/su/su.c to /usr/src/lib/libutil/login_class.c and it looks setusercontext() is setting the priority zero (0) right but the moment it come out from the setusercontext() call in su.c, the priority has already turn to 65504. I have marked this issue as "serious". It is serious because normal priority processes crawl on my machine. Maximum priority value for normal priority processes can take is 20, not 65504. Normal priority processes are expected to run at priority zero (0) as it is specified in /etc/login.conf under login class "default". >How-To-Repeat: Compile and run the following program: #include #include #include #include main(int argc, char * argv[]) { struct rtprio rtp; if (rtprio(RTP_LOOKUP, 0, &rtp)) { printf("Cannot get priority!\n"); exit(-1); } printf("Priority %d\n", rtp.prio); } The priority class can be obtained by running rtprio. >Fix: I find it bit difficult to understand why the priority value get changed as I explained under Full Description. If somebody could help me to find where the problem is, I could possibly be able to develop a patch. >Release-Note: >Audit-Trail: >Unformatted: