Daniel De Graaf | 803eb04 | 2011-03-14 11:29:37 -0400 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * Xen balloon functionality |
| 3 | */ |
| 4 | |
| 5 | #define RETRY_UNLIMITED 0 |
| 6 | |
| 7 | struct balloon_stats { |
| 8 | /* We aim for 'current allocation' == 'target allocation'. */ |
| 9 | unsigned long current_pages; |
| 10 | unsigned long target_pages; |
David Vrabel | 1cf6a6c | 2015-06-25 16:29:18 +0100 | [diff] [blame] | 11 | unsigned long target_unpopulated; |
Daniel De Graaf | 803eb04 | 2011-03-14 11:29:37 -0400 | [diff] [blame] | 12 | /* Number of pages in high- and low-memory balloons. */ |
| 13 | unsigned long balloon_low; |
| 14 | unsigned long balloon_high; |
David Vrabel | de5a77d | 2015-06-25 12:08:20 +0100 | [diff] [blame] | 15 | unsigned long total_pages; |
Daniel De Graaf | 803eb04 | 2011-03-14 11:29:37 -0400 | [diff] [blame] | 16 | unsigned long schedule_delay; |
| 17 | unsigned long max_schedule_delay; |
| 18 | unsigned long retry_count; |
| 19 | unsigned long max_retry_count; |
| 20 | }; |
| 21 | |
| 22 | extern struct balloon_stats balloon_stats; |
| 23 | |
| 24 | void balloon_set_new_target(unsigned long target); |
Konrad Rzeszutek Wilk | b6f3067 | 2011-03-15 10:23:57 -0400 | [diff] [blame] | 25 | |
David Vrabel | 81b286e | 2015-06-25 13:12:46 +0100 | [diff] [blame] | 26 | int alloc_xenballooned_pages(int nr_pages, struct page **pages); |
Stefano Stabellini | 693394b | 2011-09-29 11:57:55 +0100 | [diff] [blame] | 27 | void free_xenballooned_pages(int nr_pages, struct page **pages); |
Dan Magenheimer | a50777c | 2011-07-08 12:26:21 -0600 | [diff] [blame] | 28 | |
Kay Sievers | 0706802 | 2011-12-14 15:32:50 -0800 | [diff] [blame] | 29 | struct device; |
Dan Magenheimer | a50777c | 2011-07-08 12:26:21 -0600 | [diff] [blame] | 30 | #ifdef CONFIG_XEN_SELFBALLOONING |
Kay Sievers | 0706802 | 2011-12-14 15:32:50 -0800 | [diff] [blame] | 31 | extern int register_xen_selfballooning(struct device *dev); |
Dan Magenheimer | a50777c | 2011-07-08 12:26:21 -0600 | [diff] [blame] | 32 | #else |
Kay Sievers | 0706802 | 2011-12-14 15:32:50 -0800 | [diff] [blame] | 33 | static inline int register_xen_selfballooning(struct device *dev) |
Dan Magenheimer | a50777c | 2011-07-08 12:26:21 -0600 | [diff] [blame] | 34 | { |
| 35 | return -ENOSYS; |
| 36 | } |
| 37 | #endif |