aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2016-03-19 08:30:20 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2016-03-20 14:30:31 -0400
commit59a6e9efdd1b75c6e2c4a07bad361b4fa7aa741c (patch)
tree6b7f64c8ec4f3b80a9fc3aff3c6285175948d3c7 /kernel/time
parente9b22ab48acccba501490f05a367647fcb9902c2 (diff)
hrtimer integration: properly trace late-added timers
When tasks add timers that have already expired (e.g., when preempted during schedule_hrtimeout), we should not use the expriration time as the reference time point, but rather the time when the timer was added (the delay then includes activation of ksoftirqd, etc.).
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/hrtimer.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 70aebc72dfb8..a6d5b061ee67 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1518,12 +1518,17 @@ static enum hrtimer_restart hrtimer_wakeup(struct hrtimer *timer)
1518 t->task = NULL; 1518 t->task = NULL;
1519 if (task) 1519 if (task)
1520 { 1520 {
1521#ifdef CONFIG_SCHED_OVERHEAD_TRACE
1521 if (is_realtime(task)) 1522 if (is_realtime(task))
1522 { 1523 {
1523 ktime_t expires = hrtimer_get_expires(timer); 1524 ktime_t expires = hrtimer_get_expires(timer);
1524 lt_t intended_release = ktime_to_ns(expires); 1525 /* Fix up timers that were added past their due date;
1526 * that's not really release latency. */
1527 lt_t intended_release = max(expires.tv64,
1528 timer->when_added.tv64);
1525 TS_RELEASE_LATENCY(intended_release); 1529 TS_RELEASE_LATENCY(intended_release);
1526 } 1530 }
1531#endif
1527 TS_RELEASE_START; 1532 TS_RELEASE_START;
1528 wake_up_process(task); 1533 wake_up_process(task);
1529 TS_RELEASE_END; 1534 TS_RELEASE_END;