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] [IA64] ia64 counter part of 19374:e655cb2

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [IA64] ia64 counter part of 19374:e655cb27d085.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 31 Mar 2009 08:10:18 -0700
Delivery-date: Tue, 31 Mar 2009 08:10:50 -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 Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
# Date 1238118848 -32400
# Node ID 5e4dd7079c484192e8621e64d817d58b995b4f75
# Parent  dee5bc89873e33641c5ad4f5ae3990e8a5ddc246
[IA64] ia64 counter part of 19374:e655cb27d085.

This patch is the ia64 counter part of 19374:e655cb27d085.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 xen/include/asm-ia64/mm.h |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff -r dee5bc89873e -r 5e4dd7079c48 xen/include/asm-ia64/mm.h
--- a/xen/include/asm-ia64/mm.h Tue Mar 10 11:00:34 2009 +0900
+++ b/xen/include/asm-ia64/mm.h Fri Mar 27 10:54:08 2009 +0900
@@ -228,10 +228,18 @@ static inline struct domain *page_get_ow
 
     do {
         x = y;
-        if (unlikely((x & PGC_count_mask) == 0) ||  /* Not allocated? */
-            unlikely(((x + 1) & PGC_count_mask) == 0) ) {/* Count overflow? */
+        /*
+         * Count ==  0: Page is not allocated, so we cannot take a reference.
+         * Count == -1: Reference count would wrap, which is invalid.
+         * Count == -2: Remaining unused ref is reserved for get_page_light().
+         */
+        /*
+         * On ia64, get_page_light() isn't defined so that it doesn't
+         * make sense to take care of Count == -2.
+         * Just for consistency with x86.
+         */
+        if ( unlikely(((x + 2) & PGC_count_mask) <= 2) )
             return NULL;
-        }
         y = cmpxchg_acq(&page->count_info, x, x + 1);
     } while (unlikely(y != x));
 
@@ -247,7 +255,8 @@ static inline int get_page(struct page_i
     if (likely(owner == domain))
         return 1;
 
-    put_page(page);
+    if (owner != NULL)
+        put_page(page);
 
     /* if (!domain->is_dying) */ /* XXX: header inclusion hell */
     gdprintk(XENLOG_INFO,

_______________________________________________
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] [IA64] ia64 counter part of 19374:e655cb27d085., Xen patchbot-unstable <=