From: Keir Fraser Date: Thu, 17 Jun 2010 07:50:55 +0000 (+0100) Subject: cpuidle: reduce redundant cost in cstate_restore_tsc for nonstop tsc X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~11915 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3358e0fe7f94b4f6bf8cdbaffa86693939e3fec5;p=xen.git cpuidle: reduce redundant cost in cstate_restore_tsc for nonstop tsc Signed-off-by: Wei Gang --- diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c index d500490254..3a824ec516 100644 --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -664,14 +664,17 @@ static void __init init_platform_timer(void) 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 ) stime_delta = 0;