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] tmem: skip special case in alloc_heap_pag

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] tmem: skip special case in alloc_heap_pages() if tmem holds no pages
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 24 Jun 2010 14:00:25 -0700
Delivery-date: Thu, 24 Jun 2010 14:02:14 -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.fraser@xxxxxxxxxx>
# Date 1277331802 -3600
# Node ID c362e793f0a039fbacaf51ef01cefda5792f0032
# Parent  e2f5e4f3481c250ebc9e7c3107238d51642a99fc
tmem: skip special case in alloc_heap_pages() if tmem holds no pages
Signed-off-by: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
---
 xen/common/page_alloc.c |    9 ++++++---
 xen/common/tmem.c       |    5 +++++
 xen/include/xen/tmem.h  |    1 +
 3 files changed, 12 insertions(+), 3 deletions(-)

diff -r e2f5e4f3481c -r c362e793f0a0 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c   Tue Jun 22 16:22:30 2010 +0100
+++ b/xen/common/page_alloc.c   Wed Jun 23 23:23:22 2010 +0100
@@ -316,11 +316,14 @@ static struct page_info *alloc_heap_page
     spin_lock(&heap_lock);
 
     /*
-     * TMEM: When available memory is scarce, allow only mid-size allocations
-     * to avoid worst of fragmentation issues. Others try TMEM pools then fail.
+     * TMEM: When available memory is scarce due to tmem absorbing it, allow
+     * only mid-size allocations to avoid worst of fragmentation issues.
+     * Others try tmem pools then fail.  This is a workaround until all
+     * post-dom0-creation-multi-page allocations can be eliminated.
      */
     if ( opt_tmem && ((order == 0) || (order >= 9)) &&
-         (total_avail_pages <= midsize_alloc_zone_pages) )
+         (total_avail_pages <= midsize_alloc_zone_pages) &&
+         tmem_freeable_pages() )
         goto try_tmem;
 
     /*
diff -r e2f5e4f3481c -r c362e793f0a0 xen/common/tmem.c
--- a/xen/common/tmem.c Tue Jun 22 16:22:30 2010 +0100
+++ b/xen/common/tmem.c Wed Jun 23 23:23:22 2010 +0100
@@ -2850,6 +2850,11 @@ EXPORT void *tmem_relinquish_pages(unsig
     return pfp;
 }
 
+EXPORT unsigned long tmem_freeable_pages(void)
+{
+    return tmh_freeable_pages();
+}
+
 /* called at hypervisor startup */
 static int __init init_tmem(void)
 {
diff -r e2f5e4f3481c -r c362e793f0a0 xen/include/xen/tmem.h
--- a/xen/include/xen/tmem.h    Tue Jun 22 16:22:30 2010 +0100
+++ b/xen/include/xen/tmem.h    Wed Jun 23 23:23:22 2010 +0100
@@ -11,6 +11,7 @@
 
 extern void tmem_destroy(void *);
 extern void *tmem_relinquish_pages(unsigned int, unsigned int);
+extern unsigned long tmem_freeable_pages(void);
 extern int  opt_tmem;
 
 #endif /* __XEN_TMEM_H__ */

_______________________________________________
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] tmem: skip special case in alloc_heap_pages() if tmem holds no pages, Xen patchbot-unstable <=