All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Andy Lutomirski <luto@amacapital.net>,
	Linus Torvalds <torvalds@linux-foundation.org>
Cc: John Stultz <john.stultz@linaro.org>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Gleb Natapov <gleb@kernel.org>, kvm list <kvm@vger.kernel.org>,
	Ralf Baechle <ralf@linux-mips.org>,
	Andrew Lutomirski <luto@kernel.org>
Subject: Re: [GIT PULL] First batch of KVM changes for 4.1
Date: Sat, 18 Apr 2015 18:20:46 +0200	[thread overview]
Message-ID: <5532845E.3040107@redhat.com> (raw)
In-Reply-To: <CALCETrVc-kdvs2xPi6rDwYt7E+b=q_GXU+tdrgQEopmOUDAgrQ@mail.gmail.com>



On 18/04/2015 00:25, Andy Lutomirski wrote:
>> Isn't the *whole* point of pvclock_clocksource_read() to be a native
>> rdtsc with scaling? How does it cause that kind of insane pain?

It's possible that your machine ends up with PVCLOCK_TSC_STABLE_BIT
clear, so you get an atomic cmpxchg in addition (and associated
cacheline bouncing, since anything reading the clocksource in the kernel
will cause that variable to bounce).  But that's not too common on
recent machines.

Is the vsyscall faster for you or does it degenerate to the syscall?  If
so, you have PVCLOCK_TSC_STABLE_BIT clear.

> An unnecessarily complicated protocol, a buggy host implementation,
> and an unnecessarily complicated guest implementation :(

pvclock_clocksource_read() itself is not scary and need not worry about
the buggy host implementation (preempt_disable makes things easy).  It's
the vDSO stuff that has the nice things.

There's a few micro-optimizations that we could do (the guest
implementation _is_ unnecessarily baroque), but it may not be enough if
the rdtsc_barrier()s (lfence) are the performance killers.  Will look
closely on Monday.

Paolo

>> Oh well. Some paravirt person would need to look and care.
> 
> The code there is a bit scary.
> 
> --Andy
> 
>>
>>            Linus
> 
> 
> 

  parent reply	other threads:[~2015-04-18 16:20 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-10 15:01 [GIT PULL] First batch of KVM changes for 4.1 Paolo Bonzini
2015-04-17  8:52 ` Peter Zijlstra
2015-04-17  9:17   ` Peter Zijlstra
2015-04-17 10:09     ` Paolo Bonzini
2015-04-17 10:36       ` Peter Zijlstra
2015-04-17 10:38         ` Paolo Bonzini
2015-04-17 10:55           ` Peter Zijlstra
2015-04-17 12:46             ` Paolo Bonzini
2015-04-17 13:10               ` Peter Zijlstra
2015-04-17 13:38                 ` Paolo Bonzini
2015-04-17 13:43                   ` Peter Zijlstra
2015-04-17 14:57                     ` Paolo Bonzini
2015-04-17 19:01                   ` Marcelo Tosatti
2015-04-17 19:16                     ` Andy Lutomirski
2015-04-17 19:57                     ` Paolo Bonzini
2015-04-17 20:18                       ` Marcelo Tosatti
2015-04-17 20:39                         ` Andy Lutomirski
2015-04-17 21:28                           ` Linus Torvalds
2015-04-17 21:42                             ` Andy Lutomirski
2015-04-17 22:04                               ` Linus Torvalds
2015-04-17 22:25                                 ` Andy Lutomirski
2015-04-17 23:39                                   ` Marcelo Tosatti
2015-04-18 16:20                                   ` Paolo Bonzini [this message]
2015-04-20 16:59                         ` Paolo Bonzini
2015-04-20 20:27                           ` Andy Lutomirski
2015-04-22 21:21                             ` Marcelo Tosatti
2015-04-23  9:13                               ` Paolo Bonzini
2015-04-23 11:51                                 ` Marcelo Tosatti
2015-04-23 12:02                                   ` Paolo Bonzini
2015-04-23 17:06                                     ` Marcelo Tosatti
2015-04-22 20:56                           ` Marcelo Tosatti
2015-04-22 21:01                             ` Paolo Bonzini
2015-04-22 22:55                               ` Marcelo Tosatti
2015-04-23 11:29                                 ` Paolo Bonzini

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=5532845E.3040107@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=gleb@kernel.org \
    --cc=john.stultz@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=luto@kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=peterz@infradead.org \
    --cc=ralf@linux-mips.org \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.