Hi, I need a confirmation that I got this right:
1. A thread gets created and put on a run queue, put there by class specific enqueue_task(), correct?
2. schedule() then picks this thread(assuming it is the best one), by calling the class specific pick_next() function and then switches it on the CPU, correct?
3. when the thread is on the CPU one of two things can happen assuming that it always have work to do, preemption or blocked, correct?
4. if the thread gets blocked the class specific dequeue_task() will be called and put it on a sleep queue, correct?
5. if the thread gets preempted the class specific function check_preempt_curr() will be called and the thread gets put back on its run queue, correct?
In the function check_preempt_curr_rt() I'm a little confused. Linux priorities ranges from 1-140 where 1 is the "highest" but the real-time priorities ranges from 1-99 where 99 is the highest? Is this correct? And p->prio in check_preempt_curr_rt() is the priority ranging from 1-140 with 1 highest right? and p->rt_prioirty is rt-prio ranging from 1-99, with 99 highest?
Code:
static void check_preempt_curr_rt(struct rq *rq, struct task_struct *p)
{
if (p->prio < rq->curr->prio) {
resched_task(rq->curr);
}
}
With this assumptions p is preempting rq->curr right? that is p gets ON the CPU and rq-curr gets OFF the CPU?