Re: [PATCH] Cleanup __pvclock_read_cycles to remove useless variables

From: Minfei Huang
Date: Wed May 11 2016 - 11:20:15 EST


On 05/11/16 at 04:24P, Paolo Bonzini wrote:
>
>
> On 30/04/2016 23:57, Andy Lutomirski wrote:
> >> > Should we kill __pvclock_read_cycles in favor of vread_pvclock? It looks
> >> > doable at a quick scan...
> >> >
> > The in-kernel version might have to be a bit different because it
> > needs to handle the !stable case. If !stable, it should just use the
> > current CPU's copy which means that, realistically, it should just
> > get_cpu and use the local copy unconditionally. Other than that, it
> > could look a lot like the vread_pvclock variant.
> >
> > But I agree, the current thing is incomprehensible.
>
> It also lacks smp_rmb()s. One is more or less implicit in rdtsc, but
> you need one to separate __pvclock_read_cycles's reads of src->foo from
> pvclock_read_flags's read of src->version.
>
> Minfei, would you like to take a look?

Sure. I will take a look about this issue.

Thanks
Minfei

>
> Paolo