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


Groups > linux.kernel > #1432071 > unrolled thread

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

Started byPaolo Bonzini <pbonzini@redhat.com>
First post2016-06-27 16:20 +0200
Last post2016-06-27 16:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

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

FromPaolo Bonzini <pbonzini@redhat.com>
Date2016-06-27 16:20 +0200
SubjectRe: [PATCH v2 0/2] pvclock: more code cleanup
Message-ID<rOFyh-1kx-15@gated-at.bofh.it>

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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web