[lkml]   [2008]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] x86: Fix call to set_cyc2ns_scale() from time_cpufreq_notifier()
Karsten Wiese <> writes:

> 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.

It is still wrong because set_cyc2ns_scale() needs to execute on the target CPU
because it does rdtsc on that CPU. If you're on another CPU you'll
get the wrong values if the TSCs are not synchronized.

Still wrong as just disabling preemption around the call is not correct,
it would need to cover the complete notifier event and also the cpufreq
code would need to guarantee it is always already running on the correct
CPU (not sure that is the case currently)

The whole thing needs to be either preempt disabled or the RDTSC update code
needs to be moved into a smp_call_function_simple() [my old
"redesigned sched_clock code" did that]

Using smp_call_function_simple() would be probably the right fix,
perhaps conditional on a check for unsync TSC.


 \ /
  Last update: 2008-04-07 14:37    [W:0.027 / U:3.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site