Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1418244

Re: [PATCH 3/3 V2] pvclock: Get rid of __pvclock_read_cycles in function pvclock_read_flags

From Paolo Bonzini <pbonzini@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 3/3 V2] pvclock: Get rid of __pvclock_read_cycles in function pvclock_read_flags
Date 2016-06-09 13:30 +0200
Message-ID <rI6jU-5Fr-7@gated-at.bofh.it> (permalink)
References <rDjhL-8fO-3@gated-at.bofh.it> <rDLxn-rd-1@gated-at.bofh.it> <rHGSu-685-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 08/06/2016 10:17, Borislav Petkov wrote:
>> > -		version = __pvclock_read_cycles(src, &ret, &flags);
>> > +		version = src->version;
>> > +		/* Make the latest version visible */
>> > +		smp_rmb();
>> > +
>> > +		flags = src->flags;
>> >  		/* Make sure that the version double-check is last. */
> What does that comment mean over the barrier? It should be over the
> "while" line IMO.
> 
>> >  		smp_rmb();
> Why the two barriers back-to-back? Can't have one at the end for all?
> 

This is basically implementing a seqcount.  It needs two barriers and,
technically, they should be virt_rmb() -- it really doesn't matter of
course because reads are never reordered on x86.

Paolo

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 3/3 V2] pvclock: Get rid of __pvclock_read_cycles in  function pvclock_read_flags Borislav Petkov <bp@suse.de> - 2016-06-08 10:20 +0200
  Re: [PATCH 3/3 V2] pvclock: Get rid of __pvclock_read_cycles in  function pvclock_read_flags Paolo Bonzini <pbonzini@redhat.com> - 2016-06-09 13:30 +0200
    Re: [PATCH 3/3 V2] pvclock: Get rid of __pvclock_read_cycles in  function pvclock_read_flags Borislav Petkov <bp@suse.de> - 2016-06-09 13:30 +0200
      Re: [PATCH 3/3 V2] pvclock: Get rid of __pvclock_read_cycles in  function pvclock_read_flags Paolo Bonzini <pbonzini@redhat.com> - 2016-06-09 14:40 +0200

csiph-web