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; 11803eb047SDaniel De Graaf /* Number of pages in high- and low-memory balloons. */ 12803eb047SDaniel De Graaf unsigned long balloon_low; 13803eb047SDaniel De Graaf unsigned long balloon_high; 14803eb047SDaniel De Graaf unsigned long schedule_delay; 15803eb047SDaniel De Graaf unsigned long max_schedule_delay; 16803eb047SDaniel De Graaf unsigned long retry_count; 17803eb047SDaniel De Graaf unsigned long max_retry_count; 18803eb047SDaniel De Graaf }; 19803eb047SDaniel De Graaf 20803eb047SDaniel De Graaf extern struct balloon_stats balloon_stats; 21803eb047SDaniel De Graaf 22803eb047SDaniel De Graaf void balloon_set_new_target(unsigned long target); 23b6f30679SKonrad Rzeszutek Wilk 24b6f30679SKonrad Rzeszutek Wilk int alloc_xenballooned_pages(int nr_pages, struct page** pages); 25b6f30679SKonrad Rzeszutek Wilk void free_xenballooned_pages(int nr_pages, struct page** pages); 26*a50777c7SDan Magenheimer 27*a50777c7SDan Magenheimer struct sys_device; 28*a50777c7SDan Magenheimer #ifdef CONFIG_XEN_SELFBALLOONING 29*a50777c7SDan Magenheimer extern int register_xen_selfballooning(struct sys_device *sysdev); 30*a50777c7SDan Magenheimer #else 31*a50777c7SDan Magenheimer static inline int register_xen_selfballooning(struct sys_device *sysdev) 32*a50777c7SDan Magenheimer { 33*a50777c7SDan Magenheimer return -ENOSYS; 34*a50777c7SDan Magenheimer } 35*a50777c7SDan Magenheimer #endif 36