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] [Try 2] less verbose tmem

To: "Xen-Devel (E-mail)" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] [Try 2] less verbose tmem
From: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
Date: Thu, 7 Jan 2010 09:50:34 -0800 (PST)
Cc: Jan Beulich <JBeulich@xxxxxxxxxx>
Delivery-date: Thu, 07 Jan 2010 09:51:55 -0800
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
Reduce tmem complaints per Jan's concerns in this thread
http://lists.xensource.com/archives/html/xen-devel/2010-01/msg00155.html
Now complains only if tmem HAS memory to relinquish and
memory request has order>0.

Signed-off by: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>

diff -r 4feec90815a0 xen/common/tmem.c
--- a/xen/common/tmem.c Tue Jan 05 08:40:18 2010 +0000
+++ b/xen/common/tmem.c Thu Jan 07 10:32:03 2010 -0700
@@ -2177,7 +2177,7 @@ static NOINLINE int do_tmem_control(stru
         ret = tmemc_set_var(op->u.ctrl.cli_id,subop,op->u.ctrl.arg1);
         break;
     case TMEMC_QUERY_FREEABLE_MB:
-        ret = tmh_freeable_mb();
+        ret = tmh_freeable_pages() >> (20 - PAGE_SHIFT);
         break;
     case TMEMC_SAVE_BEGIN:
     case TMEMC_RESTORE_BEGIN:
@@ -2474,7 +2474,7 @@ EXPORT void *tmem_relinquish_pages(unsig
     unsigned long evicts_per_relinq = 0;
     int max_evictions = 10;
 
-    if (!tmh_enabled())
+    if (!tmh_enabled() || !tmh_freeable_pages())
         return NULL;
 #ifdef __i386__
     return NULL;
diff -r 4feec90815a0 xen/include/xen/tmem_xen.h
--- a/xen/include/xen/tmem_xen.h        Tue Jan 05 08:40:18 2010 +0000
+++ b/xen/include/xen/tmem_xen.h        Thu Jan 07 10:32:03 2010 -0700
@@ -246,10 +246,9 @@ static inline unsigned int tmem_subpage_
     return tmh_mempool_maxalloc;
 }
 
-static inline unsigned long tmh_freeable_mb(void)
+static inline unsigned long tmh_freeable_pages(void)
 {
-    return (tmh_avail_pages() + _atomic_read(freeable_page_count)) >>
-            (20 - PAGE_SHIFT);
+    return tmh_avail_pages() + _atomic_read(freeable_page_count);
 }
 
 static inline unsigned long tmh_free_mb(void)

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] [Try 2] less verbose tmem, Dan Magenheimer <=