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] Return <4GB memory back to Xen when destroying a PAE pgd

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Return <4GB memory back to Xen when destroying a PAE pgdir.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 24 Feb 2006 13:52:07 +0000
Delivery-date: Fri, 24 Feb 2006 13:52:16 +0000
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/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/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 kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 70575c8cab99332d3836be101e6f3b6cf7228715
# Parent  5e73c92e5f1fcaae0de27dda229355a7ac848306
Return <4GB memory back to Xen when destroying a PAE pgdir.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 5e73c92e5f1f -r 70575c8cab99 
linux-2.6-xen-sparse/arch/i386/mm/init-xen.c
--- a/linux-2.6-xen-sparse/arch/i386/mm/init-xen.c      Fri Feb 24 07:28:04 2006
+++ b/linux-2.6-xen-sparse/arch/i386/mm/init-xen.c      Fri Feb 24 07:49:32 2006
@@ -759,7 +759,7 @@
 #endif
                                0,
                                pgd_ctor,
-                               PTRS_PER_PMD == 1 ? pgd_dtor : NULL);
+                               pgd_dtor);
        if (!pgd_cache)
                panic("pgtable_cache_init(): Cannot create pgd cache");
 }
diff -r 5e73c92e5f1f -r 70575c8cab99 
linux-2.6-xen-sparse/arch/i386/mm/pgtable-xen.c
--- a/linux-2.6-xen-sparse/arch/i386/mm/pgtable-xen.c   Fri Feb 24 07:28:04 2006
+++ b/linux-2.6-xen-sparse/arch/i386/mm/pgtable-xen.c   Fri Feb 24 07:49:32 2006
@@ -320,16 +320,20 @@
        }
 }
 
-/* never called when PTRS_PER_PMD > 1 */
 void pgd_dtor(void *pgd, kmem_cache_t *cache, unsigned long unused)
 {
        unsigned long flags; /* can be called from interrupt context */
 
-       spin_lock_irqsave(&pgd_lock, flags);
-       pgd_list_del(pgd);
-       spin_unlock_irqrestore(&pgd_lock, flags);
-
-       pgd_test_and_unpin(pgd);
+       if (PTRS_PER_PMD > 1) {
+               if (!xen_feature(XENFEAT_pae_pgdir_above_4gb))
+                       xen_destroy_contiguous_region((unsigned long)pgd, 0);
+       } else {
+               spin_lock_irqsave(&pgd_lock, flags);
+               pgd_list_del(pgd);
+               spin_unlock_irqrestore(&pgd_lock, flags);
+
+               pgd_test_and_unpin(pgd);
+       }
 }
 
 pgd_t *pgd_alloc(struct mm_struct *mm)

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

<Prev in Thread] Current Thread [Next in Thread>