From: Paolo Bonzini <pbonzini@redhat.com>
To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: Andy Lutomirski <luto@amacapital.net>,
Ingo Molnar <mingo@redhat.com>,
x86@kernel.org, Minfei Huang <mnghuan@gmail.com>
Subject: Re: [PATCH v2 0/2] pvclock: more code cleanup
Date: Mon, 27 Jun 2016 16:16:34 +0200 [thread overview]
Message-ID: <dff0f295-0ad2-1df9-3af5-e76dd5027b2c@redhat.com> (raw)
In-Reply-To: <1465994811-55091-1-git-send-email-pbonzini@redhat.com>
On 15/06/2016 14:46, Paolo Bonzini wrote:
> Patch 1 simplifies the pvclock.h API by moving seqcount logic into
> two new functions pvclock_read_begin and pvclock_read_retry.
> Patch 2 uses the new simplified API in the vDSO.
Andy, I've now benchmarked the patches.
Patch 2 introduces no meaningful difference, however patch 1 makes
clock_gettime slower by about 3%. I can get this back with:
diff --git a/arch/x86/include/asm/pvclock.h b/arch/x86/include/asm/pvclock.h
index 0ee92db1e9f3..d019f0cc80ec 100644
--- a/arch/x86/include/asm/pvclock.h
+++ b/arch/x86/include/asm/pvclock.h
@@ -40,7 +40,7 @@ bool pvclock_read_retry(const struct pvclock_vcpu_time_info *src,
{
/* Make sure that the version is re-read after the data. */
virt_rmb();
- return version != src->version;
+ return unlikely(version != src->version);
}
/*
... which for whatever reason makes GCC inline more aggressively.
I'm going to send v3.
Paolo
> Paolo
>
> Paolo Bonzini (2):
> pvclock: introduce seqcount-like API
> x86: vdso: use __pvclock_read_cycles
>
> arch/x86/entry/vdso/vclock_gettime.c | 25 +++++------------------
> arch/x86/include/asm/pvclock.h | 39 +++++++++++++++++++++---------------
> arch/x86/kernel/pvclock.c | 17 ++++++----------
> 3 files changed, 34 insertions(+), 47 deletions(-)
>
prev parent reply other threads:[~2016-06-27 14:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-15 12:46 Paolo Bonzini
2016-06-15 12:46 ` [PATCH v2 1/2] pvclock: introduce seqcount-like API Paolo Bonzini
2016-06-15 12:46 ` [PATCH v2 2/2] x86: vdso: use __pvclock_read_cycles Paolo Bonzini
2016-06-27 14:16 ` Paolo Bonzini [this message]
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=dff0f295-0ad2-1df9-3af5-e76dd5027b2c@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@redhat.com \
--cc=mnghuan@gmail.com \
--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
all inboxes | Powered by JetHome®