Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110799
b: refs/heads/master
c: 8083e4a
h: refs/heads/master
i:
  110797: c5117ab
  110795: e355a31
  110791: 4dc0c11
  110783: 32b5eff
v: v3
  • Loading branch information
venkatesh.pallipadi@intel.com authored and Dave Jones committed Oct 9, 2008
1 parent 4e67423 commit 0a0781d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 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: e9d95bf7eb929b9ddc9af9f4327b76c77ed4c7d6
refs/heads/master: 8083e4ad970e4eb567e31037060cdd4ba346f0c0
2 changes: 1 addition & 1 deletion trunk/include/linux/tick.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static inline ktime_t tick_nohz_get_sleep_length(void)
return len;
}
static inline void tick_nohz_stop_idle(int cpu) { }
static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return 0; }
static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return -1; }
# endif /* !NO_HZ */

#endif
11 changes: 10 additions & 1 deletion trunk/kernel/time/tick-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <linux/profile.h>
#include <linux/sched.h>
#include <linux/tick.h>
#include <linux/module.h>

#include <asm/irq_regs.h>

Expand Down Expand Up @@ -190,9 +191,17 @@ u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time)
{
struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);

*last_update_time = ktime_to_us(ts->idle_lastupdate);
if (!tick_nohz_enabled)
return -1;

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

return ktime_to_us(ts->idle_sleeptime);
}
EXPORT_SYMBOL_GPL(get_cpu_idle_time_us);

/**
* tick_nohz_stop_sched_tick - stop the idle tick from the idle task
Expand Down

0 comments on commit 0a0781d

Please sign in to comment.