xref: /linux/include/xen/balloon.h (revision 1cf6a6c82918c9aad4bb73a7e7379a649e4d8e50)
1803eb047SDaniel De Graaf /******************************************************************************
2803eb047SDaniel De Graaf  * Xen balloon functionality
3803eb047SDaniel De Graaf  */
4803eb047SDaniel De Graaf 
5803eb047SDaniel De Graaf #define RETRY_UNLIMITED	0
6803eb047SDaniel De Graaf 
7803eb047SDaniel De Graaf struct balloon_stats {
8803eb047SDaniel De Graaf 	/* We aim for 'current allocation' == 'target allocation'. */
9803eb047SDaniel De Graaf 	unsigned long current_pages;
10803eb047SDaniel De Graaf 	unsigned long target_pages;
11*1cf6a6c8SDavid Vrabel 	unsigned long target_unpopulated;
12803eb047SDaniel De Graaf 	/* Number of pages in high- and low-memory balloons. */
13803eb047SDaniel De Graaf 	unsigned long balloon_low;
14803eb047SDaniel De Graaf 	unsigned long balloon_high;
15de5a77d8SDavid Vrabel 	unsigned long total_pages;
16803eb047SDaniel De Graaf 	unsigned long schedule_delay;
17803eb047SDaniel De Graaf 	unsigned long max_schedule_delay;
18803eb047SDaniel De Graaf 	unsigned long retry_count;
19803eb047SDaniel De Graaf 	unsigned long max_retry_count;
20803eb047SDaniel De Graaf };
21803eb047SDaniel De Graaf 
22803eb047SDaniel De Graaf extern struct balloon_stats balloon_stats;
23803eb047SDaniel De Graaf 
24803eb047SDaniel De Graaf void balloon_set_new_target(unsigned long target);
25b6f30679SKonrad Rzeszutek Wilk 
2681b286e0SDavid Vrabel int alloc_xenballooned_pages(int nr_pages, struct page **pages);
27b6f30679SKonrad Rzeszutek Wilk void free_xenballooned_pages(int nr_pages, struct page **pages);
28a50777c7SDan Magenheimer 
2907068021SKay Sievers struct device;
30a50777c7SDan Magenheimer #ifdef CONFIG_XEN_SELFBALLOONING
3107068021SKay Sievers extern int register_xen_selfballooning(struct device *dev);
32a50777c7SDan Magenheimer #else
3307068021SKay Sievers static inline int register_xen_selfballooning(struct device *dev)
34a50777c7SDan Magenheimer {
35a50777c7SDan Magenheimer 	return -ENOSYS;
36a50777c7SDan Magenheimer }
37a50777c7SDan Magenheimer #endif
38