balloon.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. void free_xenballooned_pages(int nr_pages, struct page** pages);
  25. struct sys_device;
  26. #ifdef CONFIG_XEN_SELFBALLOONING
  27. extern int register_xen_selfballooning(struct sys_device *sysdev);
  28. #else
  29. static inline int register_xen_selfballooning(struct sys_device *sysdev)
  30. {
  31. return -ENOSYS;
  32. }
  33. #endif