Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Apr 2008 10:21:35 -0700
From:      Julian Elischer <julian@elischer.org>
To:        "Murty, Ravi" <ravi.murty@intel.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: thread and ksegrp priorities
Message-ID:  <480CCD1F.1010509@elischer.org>
In-Reply-To: <AEBCFC23C0E40949B10BA2C224FC61B006FFC66B@orsmsx416.amr.corp.intel.com>
References:  <AEBCFC23C0E40949B10BA2C224FC61B006FFC66B@orsmsx416.amr.corp.intel.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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"




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?480CCD1F.1010509>