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] x86: Fix circular page reference destruct

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: Fix circular page reference destruction in relinquish_memory().
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 05 Nov 2008 07:00:37 -0800
Delivery-date: Wed, 05 Nov 2008 07:01:59 -0800
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.fraser@xxxxxxxxxx>
# Date 1225193120 0
# Node ID 19549b9766fdd68380ded8efd975c41269ab2801
# Parent  2c20d026bb55722247c0d9ab81c125118a10346f
x86: Fix circular page reference destruction in relinquish_memory().

Tested by Jan Beulich and fixes a memory leak, but there is more to be
done here.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/domain.c |    1 -
 xen/arch/x86/mm.c     |   12 +++++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff -r 2c20d026bb55 -r 19549b9766fd xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c     Tue Oct 28 10:37:30 2008 +0000
+++ b/xen/arch/x86/domain.c     Tue Oct 28 11:25:20 2008 +0000
@@ -1687,7 +1687,6 @@ static int relinquish_memory(
             {
                 if ( free_page_type(page, x, 0) != 0 )
                     BUG();
-                put_page(page);
                 break;
             }
         }
diff -r 2c20d026bb55 -r 19549b9766fd xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c Tue Oct 28 10:37:30 2008 +0000
+++ b/xen/arch/x86/mm.c Tue Oct 28 11:25:20 2008 +0000
@@ -1973,6 +1973,7 @@ int free_page_type(struct page_info *pag
         page->nr_validated_ptes = 1U << PAGETABLE_ORDER;
         page->partial_pte = 0;
     }
+
     switch ( type & PGT_type_mask )
     {
     case PGT_l1_page_table:
@@ -1998,6 +1999,15 @@ int free_page_type(struct page_info *pag
         BUG();
     }
 
+    return rc;
+}
+
+
+static int __put_final_page_type(
+    struct page_info *page, unsigned long type, int preemptible)
+{
+    int rc = free_page_type(page, type, preemptible);
+
     /* No need for atomic update of type_info here: noone else updates it. */
     if ( rc == 0 )
     {
@@ -2062,7 +2072,7 @@ static int __put_page_type(struct page_i
                                            x, nx)) != x) )
                     continue;
                 /* We cleared the 'valid bit' so we do the clean up. */
-                return free_page_type(page, x, preemptible);
+                return __put_final_page_type(page, x, preemptible);
             }
 
             /*

_______________________________________________
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] x86: Fix circular page reference destruction in relinquish_memory()., Xen patchbot-unstable <=