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


Groups > linux.kernel > #1743224 > unrolled thread

[PATCH v5 2/4] x86/xen/time: set pvclock flags on xen_time_init()

Started byJoao Martins <joao.m.martins@oracle.com>
First post2017-10-02 22:50 +0200
Last post2017-10-02 22:50 +0200
Articles 2 — 2 participants

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

  [PATCH v5 2/4] x86/xen/time: set pvclock flags on xen_time_init() Joao Martins <joao.m.martins@oracle.com> - 2017-10-02 22:50 +0200
    Re: [PATCH v5 2/4] x86/xen/time: set pvclock flags on xen_time_init() Boris Ostrovsky <boris.ostrovsky@oracle.com> - 2017-10-02 22:50 +0200

#1743224 — [PATCH v5 2/4] x86/xen/time: set pvclock flags on xen_time_init()

FromJoao Martins <joao.m.martins@oracle.com>
Date2017-10-02 22:50 +0200
Subject[PATCH v5 2/4] x86/xen/time: set pvclock flags on xen_time_init()
Message-ID<uwfP4-ur-15@gated-at.bofh.it>
Specifically check for PVCLOCK_TSC_STABLE_BIT and if this bit is set,
then set it too on pvclock flags. This allows Xen clocksource to use it
and thus speeding up xen_clocksource_read() callers (i.e. sched_clock())

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
---
New in v5
---
 arch/x86/xen/time.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c
index 1ecb05db3632..fc0148d3a70d 100644
--- a/arch/x86/xen/time.c
+++ b/arch/x86/xen/time.c
@@ -372,6 +372,7 @@ static const struct pv_time_ops xen_time_ops __initconst = {
 
 static void __init xen_time_init(void)
 {
+	struct pvclock_vcpu_time_info *pvti;
 	int cpu = smp_processor_id();
 	struct timespec tp;
 
@@ -395,6 +396,14 @@ static void __init xen_time_init(void)
 
 	setup_force_cpu_cap(X86_FEATURE_TSC);
 
+	/*
+	 * We check ahead on the primary time info if this
+	 * bit is supported hence speeding up Xen clocksource.
+	 */
+	pvti = &__this_cpu_read(xen_vcpu)->time;
+	if (pvti->flags & PVCLOCK_TSC_STABLE_BIT)
+		pvclock_set_flags(PVCLOCK_TSC_STABLE_BIT);
+
 	xen_setup_runstate_info(cpu);
 	xen_setup_timer(cpu);
 	xen_setup_cpu_clockevents();
-- 
2.11.0

[toc] | [next] | [standalone]


#1743252

FromBoris Ostrovsky <boris.ostrovsky@oracle.com>
Date2017-10-02 22:50 +0200
Message-ID<uwfP8-ur-93@gated-at.bofh.it>
In reply to#1743224
On 10/02/2017 02:31 PM, Joao Martins wrote:
> Specifically check for PVCLOCK_TSC_STABLE_BIT and if this bit is set,
> then set it too on pvclock flags. This allows Xen clocksource to use it
> and thus speeding up xen_clocksource_read() callers (i.e. sched_clock())
>
> Signed-off-by: Joao Martins <joao.m.martins@oracle.com>

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web