thread and ksegrp priorities
Julian Elischer
julian at elischer.org
Mon Apr 21 17:21:35 UTC 2008
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 at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
More information about the freebsd-hackers
mailing list