[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1ade9d3e-2064-c811-f718-371d91c7874c@redhat.com>
Date: Thu, 9 Jun 2016 13:21:18 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Borislav Petkov <bp@...e.de>, Minfei Huang <mnghuan@...il.com>
Cc: luto@...nel.org, hpa@...or.com, mingo@...hat.com,
tglx@...utronix.de, x86@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3 V2] pvclock: Get rid of __pvclock_read_cycles in
function pvclock_read_flags
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
Powered by blists - more mailing lists