[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1254790211-15416-3-git-send-email-jeremy.fitzhardinge@citrix.com>
Date: Mon, 5 Oct 2009 17:50:08 -0700
From: Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>
To: Xen-devel <xen-devel@...ts.xensource.com>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
kurt.hackel@...cle.com,
Dan Magenheimer <dan.magenheimer@...cle.com>,
Keir Fraser <keir.fraser@...citrix.com>,
Glauber de Oliveira Costa <gcosta@...hat.com>,
Avi Kivity <avi@...hat.com>,
Zach Brown <zach.brown@...cle.com>,
the arch/x86 maintainers <x86@...nel.org>,
Chris Mason <chris.mason@...cle.com>,
Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>
Subject: [PATCH 2/5] x86/pvclock: no need to use strong read barriers in pvclock_get_time_values
The time values are guaranteed to be only updated by the pcpu that the
vcpu is currently running on (preempting the guest), so there's never
any risk of cross-pcpu races. Therefore, we only need a barrier to
prevent compiler reordering.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>
---
arch/x86/kernel/pvclock.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c
index 963f349..5ecce7f 100644
--- a/arch/x86/kernel/pvclock.c
+++ b/arch/x86/kernel/pvclock.c
@@ -86,12 +86,12 @@ static unsigned pvclock_get_time_values(struct pvclock_shadow_time *dst,
{
do {
dst->version = src->version;
- rmb(); /* fetch version before data */
+ barrier(); /* fetch version before data */
dst->tsc_timestamp = src->tsc_timestamp;
dst->system_timestamp = src->system_time;
dst->tsc_to_nsec_mul = src->tsc_to_system_mul;
dst->tsc_shift = src->tsc_shift;
- rmb(); /* test version after fetching data */
+ barrier(); /* test version after fetching data */
} while ((src->version & 1) || (dst->version != src->version));
return dst->version;
--
1.6.2.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists