lkml.org 
[lkml]   [2016]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH v2 0/2] pvclock: more code cleanup
From
Date


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

\
 
 \ /
  Last update: 2016-06-27 17:01    [W:0.037 / U:1.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site