acpi_enter_[simple|bm] routines does us to pm tick conversion on every
idle wakeup and the value is only used in /proc/acpi display. We can
store the time in us and convert it into pm ticks before printing instead and
avoid the conversion in the common path.
Signed-off-by: Venkatesh Pallipadi <venki@google.com>
Signed-off-by: Len Brown <len.brown@intel.com>
static unsigned int latency_factor __read_mostly = 2;
module_param(latency_factor, uint, 0644);
static unsigned int latency_factor __read_mostly = 2;
module_param(latency_factor, uint, 0644);
-static s64 us_to_pm_timer_ticks(s64 t)
+static u64 us_to_pm_timer_ticks(s64 t)
{
return div64_u64(t * PM_TIMER_FREQUENCY, 1000000);
}
{
return div64_u64(t * PM_TIMER_FREQUENCY, 1000000);
}
seq_puts(seq, "demotion[--] ");
seq_puts(seq, "demotion[--] ");
- seq_printf(seq, "latency[%03d] usage[%08d] duration[%020llu]\n",
+ seq_printf(seq, "latency[%03d] usage[%08d] duration[%020Lu]\n",
pr->power.states[i].latency,
pr->power.states[i].usage,
pr->power.states[i].latency,
pr->power.states[i].usage,
- (unsigned long long)pr->power.states[i].time);
+ us_to_pm_timer_ticks(pr->power.states[i].time));
ktime_t kt1, kt2;
s64 idle_time_ns;
s64 idle_time;
ktime_t kt1, kt2;
s64 idle_time_ns;
s64 idle_time;
pr = __get_cpu_var(processors);
pr = __get_cpu_var(processors);
idle_time = idle_time_ns;
do_div(idle_time, NSEC_PER_USEC);
idle_time = idle_time_ns;
do_div(idle_time, NSEC_PER_USEC);
- sleep_ticks = us_to_pm_timer_ticks(idle_time);
-
/* Tell the scheduler how much we idled: */
sched_clock_idle_wakeup_event(idle_time_ns);
/* Tell the scheduler how much we idled: */
sched_clock_idle_wakeup_event(idle_time_ns);
cx->usage++;
lapic_timer_state_broadcast(pr, cx, 0);
cx->usage++;
lapic_timer_state_broadcast(pr, cx, 0);
- cx->time += sleep_ticks;
ktime_t kt1, kt2;
s64 idle_time_ns;
s64 idle_time;
ktime_t kt1, kt2;
s64 idle_time_ns;
s64 idle_time;
pr = __get_cpu_var(processors);
pr = __get_cpu_var(processors);
idle_time = idle_time_ns;
do_div(idle_time, NSEC_PER_USEC);
idle_time = idle_time_ns;
do_div(idle_time, NSEC_PER_USEC);
- sleep_ticks = us_to_pm_timer_ticks(idle_time);
/* Tell the scheduler how much we idled: */
sched_clock_idle_wakeup_event(idle_time_ns);
/* Tell the scheduler how much we idled: */
sched_clock_idle_wakeup_event(idle_time_ns);
cx->usage++;
lapic_timer_state_broadcast(pr, cx, 0);
cx->usage++;
lapic_timer_state_broadcast(pr, cx, 0);
- cx->time += sleep_ticks;