diff options
-rw-r--r-- | include/linux/hrtimer.h | 2 | ||||
-rw-r--r-- | kernel/time/hrtimer.c | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 720063df0ac0..dcbbd65c8af1 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -109,7 +109,7 @@ struct hrtimer { | |||
109 | void *start_site; | 109 | void *start_site; |
110 | char start_comm[16]; | 110 | char start_comm[16]; |
111 | #endif | 111 | #endif |
112 | #ifdef CONFIG_REPORT_TIMER_LATENCY | 112 | #if defined(CONFIG_REPORT_TIMER_LATENCY) || defined(CONFIG_SCHED_OVERHEAD_TRACE) |
113 | ktime_t when_added; | 113 | ktime_t when_added; |
114 | #endif | 114 | #endif |
115 | }; | 115 | }; |
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; |