Skip to content
Snippets Groups Projects
Commit a0b0997b authored by mihairenea's avatar mihairenea
Browse files

determine_next_mode(): check if process is runnable

parent cac00e85
No related branches found
No related tags found
No related merge requests found
...@@ -904,8 +904,30 @@ static inline int determine_next_mode_pb(struct rq *rq) ...@@ -904,8 +904,30 @@ static inline int determine_next_mode_pb(struct rq *rq)
* Is the tick interrupt active in this moment? * Is the tick interrupt active in this moment?
*/ */
if(pb->count_admin_cycles > pb->n_admin_cycles){ if(pb->count_admin_cycles > pb->n_admin_cycles){
/*
* If the current plan_entry's process is blocked, we cannot
* go in PB_EXEC_MODE. The reason could be, that administrative
* tasks were pushed forward by the default scheduler and the IO
* starved. We have to wait until the process is runnable.
*/
if (pb->plan[pb->c_entry].task_struct->state >= 0) {
/*
* 0 == Runnable (IO succeeded)
* >0 == stopped (Process finished)
*/
mode = PB_EXEC_MODE; mode = PB_EXEC_MODE;
pb->count_admin_cycles = 0; pb->count_admin_cycles = 0;
} else {
/*
* -1 == unrunnable
*/
mode = PB_ADMIN_MODE;
printk(KERN_WARNING "PB TASK %llu BLOCKED BY IO FOR %llu TOO MANY TICKS\n",
pb->plan[pb->c_entry].task_id,
pb->count_admin_cycles - pb->n_admin_cycles);
}
}else{ }else{
mode = PB_ADMIN_MODE; mode = PB_ADMIN_MODE;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment