aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-09-16 17:44:37 -0400
committerGlenn Elliott <gelliott@cs.unc.edu>2012-09-16 17:44:37 -0400
commit4e8f9b7c2e9134ca31feb91dee3609a95df6de56 (patch)
tree1e7a115068299b0fce7b8369731ed74bffa1a3c7 /kernel
parent4ad6ba08f0dab67bbd89a26b27f1cc86e3c45c13 (diff)
Implement real-time aux threads. G-EDF only.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 9e8d8698323b..0e4b3d40cd29 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2703,8 +2703,10 @@ try_to_wake_up(struct task_struct *p, unsigned int state, int wake_flags)
2703 unsigned long flags; 2703 unsigned long flags;
2704 int cpu, success = 0; 2704 int cpu, success = 0;
2705 2705
2706 if (is_realtime(p)) 2706 if (is_realtime(p)) {
2707 //WARN_ON(1);
2707 TRACE_TASK(p, "try_to_wake_up() state:%d\n", p->state); 2708 TRACE_TASK(p, "try_to_wake_up() state:%d\n", p->state);
2709 }
2708 2710
2709 smp_wmb(); 2711 smp_wmb();
2710 raw_spin_lock_irqsave(&p->pi_lock, flags); 2712 raw_spin_lock_irqsave(&p->pi_lock, flags);
@@ -3169,6 +3171,12 @@ asmlinkage void schedule_tail(struct task_struct *prev)
3169{ 3171{
3170 struct rq *rq = this_rq(); 3172 struct rq *rq = this_rq();
3171 3173
3174 sched_trace_task_switch_to(current);
3175
3176 if (sched_state_validate_switch()) {
3177 WARN_ON(1);
3178 }
3179
3172 finish_task_switch(rq, prev); 3180 finish_task_switch(rq, prev);
3173 3181
3174 /* 3182 /*
@@ -4416,8 +4424,16 @@ litmus_need_resched_nonpreemptible:
4416 4424
4417 post_schedule(rq); 4425 post_schedule(rq);
4418 4426
4419 if (sched_state_validate_switch()) 4427 if (sched_state_validate_switch()) {
4428 TRACE_CUR("cpu %d: have to redo scheduling decision!\n", cpu);
4420 goto litmus_need_resched_nonpreemptible; 4429 goto litmus_need_resched_nonpreemptible;
4430 }
4431 else if (current->policy == SCHED_LITMUS) {
4432 TRACE_CUR("cpu %d: valid switch to rt task %s/%d.\n", cpu, current->comm, current->pid);
4433 }
4434 else {
4435// TRACE_CUR("cpu %d: switch: %s/%d\n", cpu, current->comm, current->pid);
4436 }
4421 4437
4422 preempt_enable_no_resched(); 4438 preempt_enable_no_resched();
4423 4439
@@ -4430,8 +4446,8 @@ litmus_need_resched_nonpreemptible:
4430 4446
4431#ifdef CONFIG_LITMUS_PAI_SOFTIRQD 4447#ifdef CONFIG_LITMUS_PAI_SOFTIRQD
4432 litmus->run_tasklets(prev); 4448 litmus->run_tasklets(prev);
4433#endif 4449#endif
4434 4450
4435 srp_ceiling_block(); 4451 srp_ceiling_block();
4436} 4452}
4437EXPORT_SYMBOL(schedule); 4453EXPORT_SYMBOL(schedule);