View | Details | Raw Unified | Return to bug 69821 | Differences between
and this patch

Collapse All | Expand All

(-)linux_for_test.orig/drivers/cpufreq/cpufreq.c (-2 / +20 lines)
Lines 132-137 Link Here
132
}
132
}
133
EXPORT_SYMBOL_GPL(cpufreq_frequency_get_table);
133
EXPORT_SYMBOL_GPL(cpufreq_frequency_get_table);
134
134
135
#ifndef CONFIG_VIRT_CPU_ACCOUNTING
136
static u64 cputime64_to_usecs(const u64 j)
137
{
138
#if !(USEC_PER_SEC % HZ)
139
	return (USEC_PER_SEC / HZ) * j;
140
#else
141
# if BITS_PER_LONG == 32
142
	return (HZ_TO_USEC_MUL32 * j) >> HZ_TO_USEC_SHR32;
143
# else
144
	return (j * HZ_TO_USEC_NUM) / HZ_TO_USEC_DEN;
145
# endif
146
#endif
147
}
148
149
#else
150
#define cputime64_to_usecs cputime_to_usecs
151
#endif
152
135
static inline u64 get_cpu_idle_time_jiffy(unsigned int cpu, u64 *wall)
153
static inline u64 get_cpu_idle_time_jiffy(unsigned int cpu, u64 *wall)
136
{
154
{
137
	u64 idle_time;
155
	u64 idle_time;
Lines 144-152 Link Here
144
	idle_time += kcpustat_cpu(cpu).cpustat[CPUTIME_GUEST];
162
	idle_time += kcpustat_cpu(cpu).cpustat[CPUTIME_GUEST];
145
	idle_time += kcpustat_cpu(cpu).cpustat[CPUTIME_GUEST_NICE];
163
	idle_time += kcpustat_cpu(cpu).cpustat[CPUTIME_GUEST_NICE];
146
	if (wall)
164
	if (wall)
147
		*wall = cputime_to_usecs(cur_wall_time);
165
		*wall = cputime64_to_usecs(cur_wall_time);
148
166
149
	return cputime_to_usecs(idle_time);
167
	return cputime64_to_usecs(idle_time);
150
}
168
}
151
169
152
u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy)
170
u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy)

Return to bug 69821