WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] i386: simplify pte_read_atomic()

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] i386: simplify pte_read_atomic()
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 02 Nov 2010 04:50:46 -0700
Delivery-date: Tue, 02 Nov 2010 04:54:07 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1288374181 -3600
# Node ID faca957fd013281cdae648a7f472939eab414920
# Parent  6fae4331d5aab48d6061f4448ab72621367b8bde
i386: simplify pte_read_atomic()

There's no need for a loop here: if the value to be compared against
and the value to be stored are equal, cmpxchg{,8b} act just like a
load anyway.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 xen/include/asm-x86/x86_32/page.h |    6 +-----
 1 files changed, 1 insertion(+), 5 deletions(-)

diff -r 6fae4331d5aa -r faca957fd013 xen/include/asm-x86/x86_32/page.h
--- a/xen/include/asm-x86/x86_32/page.h Fri Oct 29 18:42:34 2010 +0100
+++ b/xen/include/asm-x86/x86_32/page.h Fri Oct 29 18:43:01 2010 +0100
@@ -84,11 +84,7 @@ extern unsigned int PAGE_HYPERVISOR_NOCA
 
 #endif
 
-#define pte_read_atomic(ptep) ({                              \
-    intpte_t __pte = *(ptep), __npte;                         \
-    while ( (__npte = cmpxchg(ptep, __pte, __pte)) != __pte ) \
-        __pte = __npte;                                       \
-    __pte; })
+#define pte_read_atomic(ptep) cmpxchg(ptep, 0, 0)
 #define pte_write_atomic(ptep, pte) do {                      \
     intpte_t __pte = *(ptep), __npte;                         \
     while ( (__npte = cmpxchg(ptep, __pte, (pte))) != __pte ) \

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] i386: simplify pte_read_atomic(), Xen patchbot-unstable <=