tmem: skip special case in alloc_heap_pages() if tmem holds no pages

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
This commit is contained in:
Keir Fraser committed 2010-06-23 23:23:22 +01:00
1 parent 7b76ecc628
commit 89784f9469
3 files changed
+12 -3

No files matched your search

+6 -3
View File
@@ -316,11 +316,14 @@ static struct page_info *alloc_heap_pages(
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;
/*
+5
View File
@@ -2850,6 +2850,11 @@ EXPORT void *tmem_relinquish_pages(unsigned int order, unsigned int memflags)
return pfp;
}
EXPORT unsigned long tmem_freeable_pages(void)
{
return tmh_freeable_pages();
}
/* called at hypervisor startup */
static int __init init_tmem(void)
{
+1
View File
@@ -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__ */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.