Date: Thu, 23 Oct 2008 11:21:49 -0700 From: "Murty, Ravi" <ravi.murty@intel.com> To: "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org> Subject: sched_thread_priority in ULE 8.0 Message-ID: <6D5D25EA3941074EB7734E51B166870401DDFA1D@orsmsx506.amr.corp.intel.com>
next in thread | raw e-mail | index | archive | help
Hello All, This is something I've been trying to figure out in the last couple of hour= s, 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 missi= ng 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 w= hy we need the else if check and a call to tdq_lowpri. If the thread is run= ning and we've boosted the thread's priority, then simply changing tdq_lowp= ri 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 =3D=3D oldpri) tdq_setlowpri(tdq, td);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6D5D25EA3941074EB7734E51B166870401DDFA1D>