lkml.org 
[lkml]   [2016]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] Cleanup __pvclock_read_cycles to remove useless variables
From
Date


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?

Paolo

\
 
 \ /
  Last update: 2016-05-11 16:41    [W:0.173 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site