diff options
author | Karsten Wiese <fzu@wemgehoertderstaat.de> | 2008-04-07 06:14:45 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-07 15:09:14 -0400 |
commit | 4f41c94d5c24e3b3453e9df03c0a80ca1acf00d2 (patch) | |
tree | 996302561d3970325980af4a324bfd8440ad5e41 /arch | |
parent | 5b13d863573e746739ccfc24ac1a9473cfee8df1 (diff) |
x86: fix call to set_cyc2ns_scale() from time_cpufreq_notifier()
In time_cpufreq_notifier() the cpu id to act upon is held in freq->cpu. Use it
instead of smp_processor_id() in the call to set_cyc2ns_scale().
This makes the preempt_*able() unnecessary and lets set_cyc2ns_scale() update
the intended cpu's cyc2ns.
Related mail/thread: http://lkml.org/lkml/2007/12/7/130
Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/tsc_32.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/tsc_64.c | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/arch/x86/kernel/tsc_32.c b/arch/x86/kernel/tsc_32.c index f14cfd9d1f94..c2241e04ea5f 100644 --- a/arch/x86/kernel/tsc_32.c +++ b/arch/x86/kernel/tsc_32.c | |||
@@ -256,9 +256,7 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val, void *data) | |||
256 | ref_freq, freq->new); | 256 | ref_freq, freq->new); |
257 | if (!(freq->flags & CPUFREQ_CONST_LOOPS)) { | 257 | if (!(freq->flags & CPUFREQ_CONST_LOOPS)) { |
258 | tsc_khz = cpu_khz; | 258 | tsc_khz = cpu_khz; |
259 | preempt_disable(); | 259 | set_cyc2ns_scale(cpu_khz, freq->cpu); |
260 | set_cyc2ns_scale(cpu_khz, smp_processor_id()); | ||
261 | preempt_enable(); | ||
262 | /* | 260 | /* |
263 | * TSC based sched_clock turns | 261 | * TSC based sched_clock turns |
264 | * to junk w/ cpufreq | 262 | * to junk w/ cpufreq |
diff --git a/arch/x86/kernel/tsc_64.c b/arch/x86/kernel/tsc_64.c index 947554ddabb6..d3bebaaad842 100644 --- a/arch/x86/kernel/tsc_64.c +++ b/arch/x86/kernel/tsc_64.c | |||
@@ -148,9 +148,7 @@ static int time_cpufreq_notifier(struct notifier_block *nb, unsigned long val, | |||
148 | mark_tsc_unstable("cpufreq changes"); | 148 | mark_tsc_unstable("cpufreq changes"); |
149 | } | 149 | } |
150 | 150 | ||
151 | preempt_disable(); | 151 | set_cyc2ns_scale(tsc_khz_ref, freq->cpu); |
152 | set_cyc2ns_scale(tsc_khz_ref, smp_processor_id()); | ||
153 | preempt_enable(); | ||
154 | 152 | ||
155 | return 0; | 153 | return 0; |
156 | } | 154 | } |