Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191426
b: refs/heads/master
c: 8c7b09f
h: refs/heads/master
v: v3
  • Loading branch information
Arjan van de Ven authored and Ingo Molnar committed May 9, 2010
1 parent 63f7218 commit a4cffe4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 595aac488b546c7185be7e29c8ae165a588b2a9f
refs/heads/master: 8c7b09f43f4bf570654bcc458ce96819a932303c
7 changes: 6 additions & 1 deletion trunk/kernel/time/tick-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ static void update_ts_time_stats(struct tick_sched *ts, ktime_t now)
if (ts->idle_active) {
delta = ktime_sub(now, ts->idle_entrytime);
ts->idle_sleeptime = ktime_add(ts->idle_sleeptime, delta);
ts->idle_entrytime = now;
}
}

Expand Down Expand Up @@ -205,14 +206,18 @@ static ktime_t tick_nohz_start_idle(struct tick_sched *ts)
u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time)
{
struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);
ktime_t now;

if (!tick_nohz_enabled)
return -1;

now = ktime_get();
update_ts_time_stats(ts, now);

if (ts->idle_active)
*last_update_time = ktime_to_us(ts->idle_lastupdate);
else
*last_update_time = ktime_to_us(ktime_get());
*last_update_time = ktime_to_us(now);

return ktime_to_us(ts->idle_sleeptime);
}
Expand Down

0 comments on commit a4cffe4

Please sign in to comment.