[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86/time: use correct (local) time stamp in constant-TSC calibration fast path



>>> On 09.06.16 at 14:11, <joao.m.martins@xxxxxxxxxx> wrote:
> On 06/09/2016 01:01 PM, Jan Beulich wrote:
>> This looks like a copy and paste mistake in commit 1b6a99892d ("x86:
>> Simpler time handling when TSC is constant across all power saving
>> states"), responsible for occasional many-microsecond cross-CPU skew of
>> what NOW() returns.
>> 
>> Also improve the correlation between local TSC and stime stamps
>> obtained at the end of the two calibration handlers: Compute the stime
>> one from the TSC one, instead of doing another rdtsc() for that
>> compuation.
>> 
>> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
>> ---
>> As to 4.7 inclusion: This of course looks like a pretty blatant mistake
>> that has been there for many years (and hence many releases). There's
>> certainly non-zero risk that I'm overlooking something here (despite
>> Joao apparently having come to the same conclusion), so I can't really
>> make up my mind on whether to request this patch to be put there right
>> away, or rather having linger in -unstable for a while.
>> 
> Initially I thought of this as a fix too, but then wouldn't having
> t->stime_local_stamp be c->stime_local_stamp, render no use to the
> platform timer reads done on calibration? Unless we would change
> update_vcpu_system to use stime_master_stamp instead?
> stime_master_stamp field isn't used anywhere other than the dom0 injected
> cpu_frequency_change or when at boot seeding the cpu_time struct on
> init_percpu_time (and the already mentioned use on local_time_calibration) ?
> init_percpu_time also takes a different read of the platform timer per
> cpu and could probably be inherited by a read done on the boot processor
> and written on remaining CPUs, so that all would start from the same stamp.
> IOW - this sounds like time we are turning stime to be totally TSC except
> when initially seeding each cpu_time?

Did you also look at the "slow" path in local_time_calibration()? That
does use the master stamp. So in effect for the fast path the patch
changes the situation from c->stime_local_stamp being effectively
unused to c->stime_master_stamp being so. In the former case, if
that really hadn't been a typo, deleting the write of that field from
time_calibration_std_rendezvous() would have made sense, as
get_s_time() certainly is more overhead than the simply memory
read and write needed for keeping c->stime_master_stamp up to
date (despite not being used).

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.