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@oracle.com> 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@lists.xensource.com http://lists.xensource.com/xen-devel