aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2016-03-19 08:30:20 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2017-05-26 17:12:39 -0400
commit3ad97ff9c220de06e01f97c795fcee49f206595d (patch)
treec92678a28bf2842917a557e0c0c5d996667546ac /kernel
parent13113c878cbcfdedcf339a20d85c473011937dff (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')
-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 b4824e1dbc6d..c367854ce1d6 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1491,12 +1491,17 @@ static enum hrtimer_restart hrtimer_wakeup(struct hrtimer *timer)
1491 t->task = NULL; 1491 t->task = NULL;
1492 if (task) 1492 if (task)
1493 { 1493 {
1494#ifdef CONFIG_SCHED_OVERHEAD_TRACE
1494 if (is_realtime(task)) 1495 if (is_realtime(task))
1495 { 1496 {
1496 ktime_t expires = hrtimer_get_expires(timer); 1497 ktime_t expires = hrtimer_get_expires(timer);
1497 lt_t intended_release = ktime_to_ns(expires); 1498 /* Fix up timers that were added past their due date;
1499 * that's not really release latency. */
1500 lt_t intended_release = max(expires.tv64,
1501 timer->when_added.tv64);
1498 TS_RELEASE_LATENCY(intended_release); 1502 TS_RELEASE_LATENCY(intended_release);
1499 } 1503 }
1504#endif
1500 TS_RELEASE_START; 1505 TS_RELEASE_START;
1501 wake_up_process(task); 1506 wake_up_process(task);
1502 TS_RELEASE_END; 1507 TS_RELEASE_END;