Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191425
b: refs/heads/master
c: 595aac4
h: refs/heads/master
i:
  191423: a881372
v: v3
  • Loading branch information
Arjan van de Ven authored and Ingo Molnar committed May 9, 2010
1 parent 5092740 commit 63f7218
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 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: b1f724c3055fa75a31d272222213647547a2d3d4
refs/heads/master: 595aac488b546c7185be7e29c8ae165a588b2a9f
29 changes: 19 additions & 10 deletions trunk/kernel/time/tick-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,29 +150,38 @@ static void tick_nohz_update_jiffies(ktime_t now)
touch_softlockup_watchdog();
}

static void tick_nohz_stop_idle(int cpu, ktime_t now)
/*
* Updates the per cpu time idle statistics counters
*/
static void update_ts_time_stats(struct tick_sched *ts, ktime_t now)
{
struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);
ktime_t delta;

delta = ktime_sub(now, ts->idle_entrytime);
ts->idle_lastupdate = now;
ts->idle_sleeptime = ktime_add(ts->idle_sleeptime, delta);
if (ts->idle_active) {
delta = ktime_sub(now, ts->idle_entrytime);
ts->idle_sleeptime = ktime_add(ts->idle_sleeptime, delta);
}
}

static void tick_nohz_stop_idle(int cpu, ktime_t now)
{
struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);

update_ts_time_stats(ts, now);
ts->idle_active = 0;

sched_clock_idle_wakeup_event(0);
}

static ktime_t tick_nohz_start_idle(struct tick_sched *ts)
{
ktime_t now, delta;
ktime_t now;

now = ktime_get();
if (ts->idle_active) {
delta = ktime_sub(now, ts->idle_entrytime);
ts->idle_lastupdate = now;
ts->idle_sleeptime = ktime_add(ts->idle_sleeptime, delta);
}

update_ts_time_stats(ts, now);

ts->idle_entrytime = now;
ts->idle_active = 1;
sched_clock_idle_sleep_event();
Expand Down

0 comments on commit 63f7218

Please sign in to comment.