Wei, Gang
2010-Jun-17 07:37 UTC
[Xen-devel] [PATCH2/6] cpuidle: reduce redundant cost in cstate_restore_tsc for nonstop tsc
cpuidle: reduce redundant cost in cstate_restore_tsc for nonstop tsc
Signed-off-by: Wei Gang <gang.wei@intel.com>
diff -r a73188d7fadc xen/arch/x86/time.c
--- a/xen/arch/x86/time.c Sun Jun 13 06:47:31 2010 +0800
+++ b/xen/arch/x86/time.c Sun Jun 13 06:53:45 2010 +0800
@@ -664,13 +664,16 @@ static void __init init_platform_timer(v
void cstate_restore_tsc(void)
{
- struct cpu_time *t = &this_cpu(cpu_time);
- struct time_scale sys_to_tsc = scale_reciprocal(t->tsc_scale);
+ struct cpu_time *t;
+ struct time_scale sys_to_tsc;
s_time_t stime_delta;
u64 new_tsc;
if ( boot_cpu_has(X86_FEATURE_NONSTOP_TSC) )
return;
+
+ t = &this_cpu(cpu_time);
+ sys_to_tsc = scale_reciprocal(t->tsc_scale);
stime_delta = read_platform_stime() - t->stime_master_stamp;
if ( stime_delta < 0 )
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel