mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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:
1 parent
7b76ecc628
commit
89784f9469
3 files changed
+12
-3
No files matched your search
@@ -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;
|
||||
|
||||
/*
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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__ */
|
||||