linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Andy Lutomirski <luto@amacapital.net>, Borislav Petkov <bp@suse.de>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, X86 ML <x86@kernel.org>,
	Minfei Huang <mnghuan@gmail.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH] Cleanup __pvclock_read_cycles to remove useless variables
Date: Wed, 11 May 2016 16:24:37 +0200	[thread overview]
Message-ID: <573340A5.1090209@redhat.com> (raw)
In-Reply-To: <CALCETrVwn_bqeuuv7UbZzr8T2M+krjaDNgrqWd3vX0gujPm5sA@mail.gmail.com>



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

  reply	other threads:[~2016-05-11 14:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-25  6:53 [PATCH] Cleanup __pvclock_read_cycles to remove useless variables Minfei Huang
2016-04-30 10:12 ` Minfei Huang
2016-04-30 13:24 ` Borislav Petkov
2016-04-30 17:47   ` Andy Lutomirski
2016-04-30 19:17     ` Borislav Petkov
2016-04-30 21:57       ` Andy Lutomirski
2016-05-11 14:24         ` Paolo Bonzini [this message]
2016-05-11 15:19           ` Minfei Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=573340A5.1090209@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=bp@suse.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=mingo@redhat.com \
    --cc=mnghuan@gmail.com \
    --cc=mtosatti@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).