Hi Parmenides... let's see what I can help here... On Wed, Nov 24, 2010 at 03:21, Parmenides <mobile.parmenides@xxxxxxxxx> wrote: > 1. The range of value that can be taken by rt_priority is from 1 to > 99. I think, for a specific real-time process, it should be located at > some level of runqueue which also ranges from 1 to 99. Yes, AFAIK for each priority, there should be separate queue....thus to avoid lengthy lookup. >So, the level > of this real-time process should be determined by its rt_priority > field. But, in scheduler_tick() function, > > if ((p->policy == SCHED_RR) && !--p->time_slice) { > 2446 p->time_slice = task_timeslice(p); > 2447 p->first_time_slice = 0; > 2448 set_tsk_need_resched(p); > 2449 > 2450 /* put it at the end of the queue: */ > 2451 requeue_task(p, rq->active); > 2452 } > > when a process whose schedule policy is round robin uses up its time > slice, the function put the process at the end of the level. The > requeue_task() function is as follows: > > 587static void requeue_task(struct task_struct *p, prio_array_t *array) > 588{ > 589 list_move_tail(&p->run_list, array->queue + p->prio); > 590} > > It is obvious that when entering the runqueue again, the level of the > process is determined by its dynamic priority. So, which one of the > two priorities, namely real-time priority and dynamic priority, will > determine a real-time process' level in a runqueue? > AFAIK, for real time process, the priority is always fixed....hopefully CFS doesn't change that agreement...that's how POSIX decides about real time process AFAIK. > 2. I guess that for a real-time process, the dynamic priority may be > equivalent to the real-time priority. If so, the dynamic priority > shouldn't vary for the real-time process. But, when the process is > being waken up, the try_to_wake_up() function will call the > recalc_task_prio() function indirectly, which will cause the dynamic > priority to change. Is my guess wrong? yes, only for SCHED_OTHER process, the dyn prio is recalculated. > 3. Eventually, I wonder what is the meaning of dynamic priority for a > real-time process and whether there is some relationship between the > dynamic priority and the real-time priority. IMO, dynamic priority, in the meaning that "constantly adjusted prio according to current system load" isn't a concern for a real time process. -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ