From owner-freebsd-hackers@FreeBSD.ORG Mon Apr 21 17:21:35 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0BF11065672 for ; Mon, 21 Apr 2008 17:21:35 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outQ.internet-mail-service.net (outq.internet-mail-service.net [216.240.47.240]) by mx1.freebsd.org (Postfix) with ESMTP id C15438FC13 for ; Mon, 21 Apr 2008 17:21:35 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Tue, 22 Apr 2008 00:11:30 -0700 Received: from julian-mac.elischer.org (localhost [127.0.0.1]) by idiom.com (Postfix) with ESMTP id 9A2D92D6010; Mon, 21 Apr 2008 10:21:33 -0700 (PDT) Message-ID: <480CCD1F.1010509@elischer.org> Date: Mon, 21 Apr 2008 10:21:35 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: "Murty, Ravi" References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: thread and ksegrp priorities X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2008 17:21:35 -0000 Murty, Ravi wrote: > Hello All, > > > > I am working on the 6.2 FreeBSD code base and has a couple of simple > questions. The thread structure defines two priority fields > "td_base_pri" and "td_priority" while a ksegrp defines "kg_user_pri" and > "kg_pri_class". > > > > 1. Since a ksegrp can have multiple "process scope" threads, how is > kg_user_pri used and how is it related to td_base_pri and td_priority? > 2. What is the difference between td_base_pri and td_priority? > 3. If kg_user_pri changes, does it mean that the priority of all > threads that are part of the ksegrp change? > This is something that was never satisfactoraly worked out. The problem is that there is no 100% correct answer. the kg_user_pri was( I say was because the whole scheme was scrapped for 7 and 8 (so learning about 6.x is a bit of a dead end)) used to reinitialise a thread when it started running in userland again. so all threads, on transition back to user space or, rather were reatarted in user space had their priorities moved back away from privileged priorities. td_base Priority is what the thread was initialised to and td_priority is what it is actually running at at this time. if kg_user_pri changes than theoretically all associated threads would move as soon as they reached a point where their prioities were reinitialised. I can't remember the details but it was not successful and removed later. > > > It appears that these things change when a thread returns to user mode > (returns to normal user priority), when returning from a sleep (priority > boost) etc. > > > > Thanks > Ravi > > > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"