balloon.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /******************************************************************************
  2. * Xen balloon functionality
  3. */
  4. #define RETRY_UNLIMITED 0
  5. struct balloon_stats {
  6. /* We aim for 'current allocation' == 'target allocation'. */
  7. unsigned long current_pages;
  8. unsigned long target_pages;
  9. /* Number of pages in high- and low-memory balloons. */
  10. unsigned long balloon_low;
  11. unsigned long balloon_high;
  12. unsigned long schedule_delay;
  13. unsigned long max_schedule_delay;
  14. unsigned long retry_count;
  15. unsigned long max_retry_count;
  16. #ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG
  17. unsigned long hotplug_pages;
  18. unsigned long balloon_hotplug;
  19. #endif
  20. };
  21. extern struct balloon_stats balloon_stats;
  22. void balloon_set_new_target(unsigned long target);
  23. int alloc_xenballooned_pages(int nr_pages, struct page **pages,
  24. bool highmem);
  25. void free_xenballooned_pages(int nr_pages, struct page **pages);
  26. struct page *get_balloon_scratch_page(void);
  27. void put_balloon_scratch_page(void);
  28. struct device;
  29. #ifdef CONFIG_XEN_SELFBALLOONING
  30. extern int register_xen_selfballooning(struct device *dev);
  31. #else
  32. static inline int register_xen_selfballooning(struct device *dev)
  33. {
  34. return -ENOSYS;
  35. }
  36. #endif