[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <dff0f295-0ad2-1df9-3af5-e76dd5027b2c@redhat.com>
Date: Mon, 27 Jun 2016 16:16:34 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: linux-kernel@...r.kernel.org, kvm@...r.kernel.org
Cc: Andy Lutomirski <luto@...capital.net>,
Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
Minfei Huang <mnghuan@...il.com>
Subject: Re: [PATCH v2 0/2] pvclock: more code cleanup
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(-)
>
Powered by blists - more mailing lists