Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / include / xen / balloon.h
blob61f410fd74e4cf4180f7ad5ffa1d996cc1528c91
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
3 * Xen balloon functionality
4 */
6 #define RETRY_UNLIMITED 0
8 struct balloon_stats {
9 /* We aim for 'current allocation' == 'target allocation'. */
10 unsigned long current_pages;
11 unsigned long target_pages;
12 unsigned long target_unpopulated;
13 /* Number of pages in high- and low-memory balloons. */
14 unsigned long balloon_low;
15 unsigned long balloon_high;
16 unsigned long total_pages;
17 unsigned long schedule_delay;
18 unsigned long max_schedule_delay;
19 unsigned long retry_count;
20 unsigned long max_retry_count;
23 extern struct balloon_stats balloon_stats;
25 void balloon_set_new_target(unsigned long target);
27 int alloc_xenballooned_pages(int nr_pages, struct page **pages);
28 void free_xenballooned_pages(int nr_pages, struct page **pages);
30 struct device;
31 #ifdef CONFIG_XEN_SELFBALLOONING
32 extern int register_xen_selfballooning(struct device *dev);
33 #else
34 static inline int register_xen_selfballooning(struct device *dev)
36 return -ENOSYS;
38 #endif
40 #ifdef CONFIG_XEN_BALLOON
41 void xen_balloon_init(void);
42 #else
43 static inline void xen_balloon_init(void)
46 #endif
48 #ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG
49 struct resource;
50 void arch_xen_balloon_init(struct resource *hostmem_resource);
51 #endif