Alerting Linux' Real-Time FIFO Scheduler -
i'm trying change implementation of real-time scheduler in 3.13.3. far know, in real-time fifo scheduling kernel keeps queue of processes same priority , allocates cpu process @ end of queue (head), , adds process tail... want add field pcb structure (task_struct), kernel sorts queue based on new field. define new field int extra_priority
, want kernel give precedence processes higher extra_priority
whenever choosing next process queue execute... i'm wondering, whole "popping process queue" , "pushing new process tail of queue" take place? call "sort extra_priority" whenever queue changes, in order keep queue sorted time.
i haven't modified process scheduling of real time processes. based on following passage book understanding linux kernel, may able achieve modifying scheduler_tick()
function alter order of real time fifo processes.
updating time slice of real-time process
if current process fifo real-time process, scheduler_tick() has nothing do. in case, in fact, current cannot preempted lower or equal priority processes, not make sense keep time slice counter up-to-date. if current round robin real-time process, scheduler_tick() decreases time slice counter , checks whether quantum exhausted:
if (current->policy == sched_rr && !--current->time_slice) { current->time_slice = task_timeslice(current); current->first_time_slice = 0; set_tsk_need_resched(current); list_del(¤t->run_list); list_add_tail(¤t->run_list, this_rq()->active->queue+current->prio); }
Comments
Post a Comment