Re: [PATCH] Cleanup __pvclock_read_cycles to remove useless variables

From: Andy Lutomirski
Date: Sat Apr 30 2016 - 17:58:24 EST


On Apr 30, 2016 12:17 PM, "Borislav Petkov" <bp@xxxxxxx> wrote:
>
> On Sat, Apr 30, 2016 at 10:47:49AM -0700, Andy Lutomirski wrote:
> > Take a look at vread_pvclock. I decided that __pvclock_read_cycles
> > was too ugly to use and was very slow and I just gave up and rewrote
> > it.
>
> 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.

--Andy

> --
> Regards/Gruss,
> Boris.
>
> SUSE Linux GmbH, GF: Felix ImendÃrffer, Jane Smithard, Graham Norton, HRB 21284 (AG NÃrnberg)
> --