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-devel

[Xen-devel] [PATCH] introduce page_list_move()

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] introduce page_list_move()
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Thu, 18 Jun 2009 08:48:02 +0100
Cc: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Delivery-date: Thu, 18 Jun 2009 00:49:23 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
This not only allows to remove ia64's special implementation of
page_list_splice_init(), but also fixes the latent issue with the
direct list head assignment in the x86 code if that would ever get
switched back to using normal list entries for linking together pages
(i.e. whenever x86-64 is to support more tha 16Tb of memory).

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

--- 2009-06-10.orig/xen/arch/ia64/xen/domain.c  2009-06-10 10:48:29.000000000 
+0200
+++ 2009-06-10/xen/arch/ia64/xen/domain.c       2009-06-17 16:04:07.000000000 
+0200
@@ -1705,7 +1705,7 @@ static int relinquish_memory(struct doma
         }
     }
 
-    page_list_splice_init(&d->arch.relmem_list, list);
+    page_list_move(list, &d->arch.relmem_list);
 
  out:
     spin_unlock_recursive(&d->page_alloc_lock);
--- 2009-06-10.orig/xen/arch/x86/domain.c       2009-05-25 08:44:00.000000000 
+0200
+++ 2009-06-10/xen/arch/x86/domain.c    2009-06-17 16:04:46.000000000 +0200
@@ -1780,11 +1780,7 @@ static int relinquish_memory(
     }
 
     /* list is empty at this point. */
-    if ( !page_list_empty(&d->arch.relmem_list) )
-    {
-        *list = d->arch.relmem_list;
-        INIT_PAGE_LIST_HEAD(&d->arch.relmem_list);
-    }
+    page_list_move(list, &d->arch.relmem_list);
 
  out:
     spin_unlock_recursive(&d->page_alloc_lock);
--- 2009-06-10.orig/xen/include/asm-ia64/mm.h   2009-05-27 13:54:07.000000000 
+0200
+++ 2009-06-10/xen/include/asm-ia64/mm.h        2009-06-17 16:03:46.000000000 
+0200
@@ -92,24 +92,6 @@ struct page_info
     u32 tlbflush_timestamp;
 };
 
-#ifndef page_list_entry
-static inline void
-page_list_splice_init(struct page_list_head *list, struct page_list_head *head)
-{
-    if ( !page_list_empty(list) )
-    {
-        if ( head->next )
-            head->tail->list.next = page_to_mfn(list->next);
-        else
-            head->next = list->next;
-        head->tail = list->tail;
-        INIT_PAGE_LIST_HEAD(list);
-    }
-}
-#else
-# define page_list_splice_init list_splice_init
-#endif
-
 #define set_page_count(p,v)    atomic_set(&(p)->_count, v - 1)
 
 /*
--- 2009-06-10.orig/xen/include/xen/mm.h        2009-05-27 13:54:07.000000000 
+0200
+++ 2009-06-10/xen/include/xen/mm.h     2009-06-17 16:02:28.000000000 +0200
@@ -223,7 +223,15 @@ page_list_remove_head(struct page_list_h
 
     return page;
 }
-
+static inline void
+page_list_move(struct page_list_head *dst, struct page_list_head *src)
+{
+    if ( !page_list_empty(src) )
+    {
+        *dst = *src;
+        INIT_PAGE_LIST_HEAD(src);
+    }
+}
 static inline void
 page_list_splice(struct page_list_head *list, struct page_list_head *head)
 {
@@ -281,6 +289,8 @@ page_list_splice(struct page_list_head *
         list_del(&__pg->list); \
         __pg; \
     }) : NULL)
+# define page_list_move(dst, src)        (!list_empty(src) ? \
+    list_replace_init(src, dst) : (void)0)
 # define page_list_for_each(pos, head)   list_for_each_entry(pos, head, list)
 # define page_list_for_each_safe(pos, tmp, head) \
     list_for_each_entry_safe(pos, tmp, head, list)




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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] introduce page_list_move(), Jan Beulich <=