Skip to content
Snippets Groups Projects
Commit 8bdbfc5b authored by Ollrogge's avatar Ollrogge
Browse files

Terminate per events independent of next mode

parent 4f221435
No related branches found
No related tags found
No related merge requests found
......@@ -129,15 +129,19 @@ static struct task_struct * pick_next_task_pb(struct rq *rq,
current_mode = pb->mode;
next_mode = determine_next_mode_pb(rq);
pb->mode = next_mode;
if (current_mode != PB_EXEC_MODE && next_mode == PB_EXEC_MODE) {
// Necessary to manage the preempted task
printk("PUT OLD TASK BACK IN RQ\n");
put_prev_task(rq, prev);
}
if (current_mode != next_mode) {
printk("SWITCHING MODES\n");
pb->count_admin_cycles = 0;
pb->count_pb_cycles = 0;
}
// The mode does not change --> no behavior change is needed
if (next_mode == PB_EXEC_MODE) {
printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
if (current_mode == PB_EXEC_MODE) {
printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
u64 perf_counter;
......@@ -171,7 +175,12 @@ static struct task_struct * pick_next_task_pb(struct rq *rq,
pb->mode = PB_DISABLED_MODE;
pb->is_initialized = 0;
}
} else if(current_mode == PB_ADMIN_MODE) {
}
// The mode does not change --> no behavior change is needed
if (next_mode == PB_EXEC_MODE) {
printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
if(current_mode == PB_ADMIN_MODE) {
printk(KERN_DEBUG "PB ADMIN,STOP,%u,%llu\n", pb->c_entry, sched_clock());
} else {
printk("Switching from disabled to EXEC\n");
......@@ -186,16 +195,6 @@ static struct task_struct * pick_next_task_pb(struct rq *rq,
printk(KERN_ALERT "DEBUG: Passed %s %d \n",__FUNCTION__,__LINE__);
}
if (current_mode != PB_EXEC_MODE && next_mode == PB_EXEC_MODE) {
// Necessary to manage the preempted task
printk("PUT OLD TASK BACK IN RQ\n");
put_prev_task(rq, prev);
}
if (current_mode == PB_EXEC_MODE && next_mode != PB_EXEC_MODE) {
printk("RESCHEDULING OLD TASKS\n");
resched_curr(rq);
}
return picked;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment