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


Groups > linux.kernel > #1432071

Re: [PATCH v2 0/2] pvclock: more code cleanup

From Paolo Bonzini <pbonzini@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 0/2] pvclock: more code cleanup
Date 2016-06-27 16:20 +0200
Message-ID <rOFyh-1kx-15@gated-at.bofh.it> (permalink)
References <rKiqB-2zV-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



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(-)
> 

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


Thread

Re: [PATCH v2 0/2] pvclock: more code cleanup Paolo Bonzini <pbonzini@redhat.com> - 2016-06-27 16:20 +0200

csiph-web