sched_thread_priority in ULE 8.0

Murty, Ravi ravi.murty at intel.com
Thu Oct 23 18:21:57 UTC 2008


Hello All,

This is something I've been trying to figure out in the last couple of hours, but can't seem to understand.
Sched_thread_priority() updates a threads priority to "prio". If the thread is on the RUNQ, we have to pull it out and put it back at a different spot on the same queue. However, if the thread is currently running, I am missing something. If it is running shouldn't tdq->tdq_lowpri basically be same as the threads current priority (aka oldpri).. I can't seem to figure out why we need the else if check and a call to tdq_lowpri. If the thread is running and we've boosted the thread's priority, then simply changing tdq_lowpri should do it right?

I've included part of the sched_thread_priority code below.

Thanks
Ravi



The code is as follows:

...
If (prio < tdq->tdq_lowpri)
    tdq->tdq_lowpri
else if (tdq->tdq_lowpri == oldpri)
    tdq_setlowpri(tdq, td);


More information about the freebsd-hackers mailing list