aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2012-09-06 05:15:04 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2012-10-18 16:14:06 -0400
commitce313ac8c1531c11d670fd84fe2526bbb5f32f85 (patch)
tree3755aa50dcf228aa441393e7fdb118664cd4f7e2
parenta481c27ddd7d324a9f311ae9a08228499dbb7f7b (diff)
Move SCHED2 trace points to post_schedule()
Linux's post_schedule() scheduling class hook more closely matches what SCHED2 is supposed to trace, namely any scheduling overhead after the context switch. The prior trace points caught timers being armed from finish_switch(), which is already included in the context switch cost CXS. (This patch essentially reverts 8fe2fb8bb1c1cd0194608bc783d0ce7029e8d869).
-rw-r--r--kernel/sched.c8
-rw-r--r--litmus/rt_domain.c10
2 files changed, 7 insertions, 11 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 1d7b38a7ff25..c4b6bd5151ff 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4417,14 +4417,20 @@ litmus_need_resched_nonpreemptible:
4417 raw_spin_unlock_irq(&rq->lock); 4417 raw_spin_unlock_irq(&rq->lock);
4418 } 4418 }
4419 4419
4420 TS_SCHED2_START(prev);
4420 sched_trace_task_switch_to(current); 4421 sched_trace_task_switch_to(current);
4421 4422
4422 post_schedule(rq); 4423 post_schedule(rq);
4423 4424
4424 if (sched_state_validate_switch()) 4425 if (sched_state_validate_switch()) {
4426 TS_SCHED2_END(prev);
4425 goto litmus_need_resched_nonpreemptible; 4427 goto litmus_need_resched_nonpreemptible;
4428 }
4426 4429
4427 preempt_enable_no_resched(); 4430 preempt_enable_no_resched();
4431
4432 TS_SCHED2_END(prev);
4433
4428 if (need_resched()) 4434 if (need_resched())
4429 goto need_resched; 4435 goto need_resched;
4430 4436
diff --git a/litmus/rt_domain.c b/litmus/rt_domain.c
index d0b796611bea..1683d3847560 100644
--- a/litmus/rt_domain.c
+++ b/litmus/rt_domain.c
@@ -331,12 +331,7 @@ void __add_release_on(rt_domain_t* rt, struct task_struct *task,
331 list_add(&tsk_rt(task)->list, &rt->tobe_released); 331 list_add(&tsk_rt(task)->list, &rt->tobe_released);
332 task->rt_param.domain = rt; 332 task->rt_param.domain = rt;
333 333
334 /* start release timer */
335 TS_SCHED2_START(task);
336
337 arm_release_timer_on(rt, target_cpu); 334 arm_release_timer_on(rt, target_cpu);
338
339 TS_SCHED2_END(task);
340} 335}
341#endif 336#endif
342 337
@@ -349,11 +344,6 @@ void __add_release(rt_domain_t* rt, struct task_struct *task)
349 list_add(&tsk_rt(task)->list, &rt->tobe_released); 344 list_add(&tsk_rt(task)->list, &rt->tobe_released);
350 task->rt_param.domain = rt; 345 task->rt_param.domain = rt;
351 346
352 /* start release timer */
353 TS_SCHED2_START(task);
354
355 arm_release_timer(rt); 347 arm_release_timer(rt);
356
357 TS_SCHED2_END(task);
358} 348}
359 349