[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] tmem: Reduce verbosity on failed memory allocations.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1262949922 0
# Node ID 277bfc2d47b1912a4a6994ed53157ff630413bdb
# Parent  13b349c42eed80cd12549e17b8f4ead3df50ffbc
tmem: Reduce verbosity on failed memory allocations.

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>
---
 xen/common/tmem.c          |    4 ++--
 xen/include/xen/tmem_xen.h |    7 +++----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff -r 13b349c42eed -r 277bfc2d47b1 xen/common/tmem.c
--- a/xen/common/tmem.c Fri Jan 08 11:24:18 2010 +0000
+++ b/xen/common/tmem.c Fri Jan 08 11:25:22 2010 +0000
@@ -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 13b349c42eed -r 277bfc2d47b1 xen/include/xen/tmem_xen.h
--- a/xen/include/xen/tmem_xen.h        Fri Jan 08 11:24:18 2010 +0000
+++ b/xen/include/xen/tmem_xen.h        Fri Jan 08 11:25:22 2010 +0000
@@ -246,10 +246,9 @@ static inline unsigned int tmem_subpage_
     return tmh_mempool_maxalloc;
 }
 
-static inline unsigned long tmh_freeable_mb(void)
-{
-    return (tmh_avail_pages() + _atomic_read(freeable_page_count)) >>
-            (20 - PAGE_SHIFT);
+static inline unsigned long tmh_freeable_pages(void)
+{
+    return tmh_avail_pages() + _atomic_read(freeable_page_count);
 }
 
 static inline unsigned long tmh_free_mb(void)

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.