Re: [PATCH] pvclock: introduce seqcount-like API

2016-06-15 Thread Paolo Bonzini
On 09/06/2016 20:08, Andy Lutomirski wrote: > > __pvclock_read_cycles is pretty much the same as the code that is being > > inlined. Thus the only change is that __pvclock_read_cycles is called > > inside the loop rather than outside, but the loop really is expected to > > never roll so why make

Re: [PATCH] pvclock: introduce seqcount-like API

2016-06-12 Thread Minfei Huang
On 06/09/16 at 01:23P, Paolo Bonzini wrote: > The version field in struct pvclock_vcpu_time_info basically implements > a seqcount. Wrap it with the usual read_begin and read_retry functions, > and use these APIs instead of peppering the code with smp_rmb()s. > While at it, change it to the more p

Re: [PATCH] pvclock: introduce seqcount-like API

2016-06-09 Thread Andy Lutomirski
On Thu, Jun 9, 2016 at 11:03 AM, Paolo Bonzini wrote: > > > On 09/06/2016 19:12, Andy Lutomirski wrote: >> On Thu, Jun 9, 2016 at 6:45 AM, Paolo Bonzini wrote: >>> On 09/06/2016 15:35, Roman Kagan wrote: On Thu, Jun 09, 2016 at 02:47:54PM +0200, Paolo Bonzini wrote: > On 09/06/2016 14:43

Re: [PATCH] pvclock: introduce seqcount-like API

2016-06-09 Thread Paolo Bonzini
On 09/06/2016 19:12, Andy Lutomirski wrote: > On Thu, Jun 9, 2016 at 6:45 AM, Paolo Bonzini wrote: >> On 09/06/2016 15:35, Roman Kagan wrote: >>> On Thu, Jun 09, 2016 at 02:47:54PM +0200, Paolo Bonzini wrote: On 09/06/2016 14:43, Roman Kagan wrote: >>> Has it landed in any public tree? I'm

Re: [PATCH] pvclock: introduce seqcount-like API

2016-06-09 Thread Andy Lutomirski
On Thu, Jun 9, 2016 at 6:45 AM, Paolo Bonzini wrote: > > > On 09/06/2016 15:35, Roman Kagan wrote: >> On Thu, Jun 09, 2016 at 02:47:54PM +0200, Paolo Bonzini wrote: >>> On 09/06/2016 14:43, Roman Kagan wrote: On Thu, Jun 09, 2016 at 01:23:23PM +0200, Paolo Bonzini wrote: > The version fie

Re: [PATCH] pvclock: introduce seqcount-like API

2016-06-09 Thread Paolo Bonzini
On 09/06/2016 15:35, Roman Kagan wrote: > On Thu, Jun 09, 2016 at 02:47:54PM +0200, Paolo Bonzini wrote: >> On 09/06/2016 14:43, Roman Kagan wrote: >>> On Thu, Jun 09, 2016 at 01:23:23PM +0200, Paolo Bonzini wrote: The version field in struct pvclock_vcpu_time_info basically implements

Re: [PATCH] pvclock: introduce seqcount-like API

2016-06-09 Thread Roman Kagan
On Thu, Jun 09, 2016 at 02:47:54PM +0200, Paolo Bonzini wrote: > On 09/06/2016 14:43, Roman Kagan wrote: > > On Thu, Jun 09, 2016 at 01:23:23PM +0200, Paolo Bonzini wrote: > >> The version field in struct pvclock_vcpu_time_info basically implements > >> a seqcount. Wrap it with the usual read_begi

Re: [PATCH] pvclock: introduce seqcount-like API

2016-06-09 Thread Paolo Bonzini
On 09/06/2016 14:43, Roman Kagan wrote: > On Thu, Jun 09, 2016 at 01:23:23PM +0200, Paolo Bonzini wrote: >> The version field in struct pvclock_vcpu_time_info basically implements >> a seqcount. Wrap it with the usual read_begin and read_retry functions, >> and use these APIs instead of pepperin

Re: [PATCH] pvclock: introduce seqcount-like API

2016-06-09 Thread Roman Kagan
On Thu, Jun 09, 2016 at 01:23:23PM +0200, Paolo Bonzini wrote: > The version field in struct pvclock_vcpu_time_info basically implements > a seqcount. Wrap it with the usual read_begin and read_retry functions, > and use these APIs instead of peppering the code with smp_rmb()s. > While at it, chan

[PATCH] pvclock: introduce seqcount-like API

2016-06-09 Thread Paolo Bonzini
The version field in struct pvclock_vcpu_time_info basically implements a seqcount. Wrap it with the usual read_begin and read_retry functions, and use these APIs instead of peppering the code with smp_rmb()s. While at it, change it to the more pedantically correct virt_rmb(). With this change, _