From owner-freebsd-bugs@FreeBSD.ORG Tue Nov 25 11:10:09 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 CC86A1065674 for ; Tue, 25 Nov 2008 11:10:09 +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 BD9208FC1B for ; Tue, 25 Nov 2008 11:10:09 +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 mAPBA9mv053480 for ; Tue, 25 Nov 2008 11:10:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id mAPBA98G053479; Tue, 25 Nov 2008 11:10:09 GMT (envelope-from gnats) Date: Tue, 25 Nov 2008 11:10:09 GMT Message-Id: <200811251110.mAPBA98G053479@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Unga Cc: Subject: Re: kern/129164: Wrong priority value for normal processes X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Unga List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Nov 2008 11:10:09 -0000 The following reply was made to PR kern/129164; it has been noted by GNATS. From: Unga To: Garrett Cooper Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: kern/129164: Wrong priority value for normal processes Date: Tue, 25 Nov 2008 02:41:26 -0800 (PST) --- On Tue, 11/25/08, Garrett Cooper wrote: > rtp.prio is an unsigned short, and there is some rollover > because the number set for the priority is then subtracted > by 128 (see the following grepped snippets). This appears to > be a cosmetic issue which should be fixed by shifting the > starting offset for the priorities. Unless it's really a > dealbreaker (because it shouldn't be considering that > all processes are in fact fudged by this value range, but it > does touch the ULE / scheduler code a bit from the looks of > it), I would mark this bug Sev 2, Priority High. > > [gcooper@optimus ~]$ grep -rn PRI_MIN_REALTIME > /usr/src/sys/ > /usr/src/sys/kern/kern_resource.c:479: newpri = > PRI_MIN_REALTIME + rtp->prio; > /usr/src/sys/kern/kern_resource.c:511: rtp->prio = > td->td_base_user_pri - PRI_MIN_REALTIME; > /usr/src/sys/kern/kern_umtx.c:1934: if (UPRI(td) < > PRI_MIN_REALTIME + ceiling) { > /usr/src/sys/kern/kern_umtx.c:1939: if (su && > PRI_MIN_REALTIME + ceiling < uq->uq_inherited_pri) { > /usr/src/sys/kern/kern_umtx.c:1940: uq->uq_inherited_pri > = PRI_MIN_REALTIME + ceiling; > /usr/src/sys/kern/kern_umtx.c:2069: new_inherited_pri = > PRI_MIN_REALTIME + rceiling; > /usr/src/sys/kern/sched_ule.c:1406: pri = > PRI_MIN_REALTIME; > /usr/src/sys/kern/sched_ule.c:1407: pri += > ((PRI_MAX_REALTIME - PRI_MIN_REALTIME) / sched_interact) > /usr/src/sys/kern/sched_ule.c:1409: KASSERT(pri >= > PRI_MIN_REALTIME && pri <= PRI_MAX_REALTIME, > /usr/src/sys/sys/priority.h:98:#define PRI_MAX_KERN (PRI_MIN_REALTIME > - 1) > /usr/src/sys/sys/priority.h:112:#define PRI_MIN_REALTIME (128) > Thanks for the reply. I'll look more details into your above grep results. I forgot to mention, this issue does not effect both realtime and idletime. It only effect normal priority class. That is, the priority set for the normal processes does not retain. Best regards Unga