public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Question: monolitic_clock, timer_{tsc,hpet} and CPUFREQ
@ 2003-09-05  3:14 Dmitry Torokhov
  2003-09-05  8:13 ` john stultz
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Torokhov @ 2003-09-05  3:14 UTC (permalink / raw)
  To: linux-kernel

I noticed that although timer_tsc registers cpufreq notifier to detect
frequency changes and adjust cpu_khz it does not set cyc2ns_scale. Is
monotonic clocks supposed to be also accurate?

Will something like this suffice for timer_tsc (compiled, not yet booted):

--- 2.6.0-test4/arch/i386/kernel/timers/timer_tsc.c	2003-08-26 21:56:19.000000000 -0500
+++ linux-2.6.0-test4/arch/i386/kernel/timers/timer_tsc.c	2003-09-04 22:08:27.000000000 -0500
@@ -315,6 +315,7 @@
 		if (use_tsc) {
 			fast_gettimeoffset_quotient = cpufreq_scale(fast_gettimeoffset_ref, freq->new, ref_freq);
 			cpu_khz = cpufreq_scale(cpu_khz_ref, ref_freq, freq->new);
+			set_cyc2ns_scale(cpu_khz/1000);
 		}
 #endif
 	}

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-09-08 17:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-05  3:14 Question: monolitic_clock, timer_{tsc,hpet} and CPUFREQ Dmitry Torokhov
2003-09-05  8:13 ` john stultz
2003-09-07 18:57   ` Dominik Brodowski
2003-09-08 17:30     ` john stultz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox