balloon.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. unsigned long target_unpopulated;
  10. /* Number of pages in high- and low-memory balloons. */
  11. unsigned long balloon_low;
  12. unsigned long balloon_high;
  13. unsigned long total_pages;
  14. unsigned long schedule_delay;
  15. unsigned long max_schedule_delay;
  16. unsigned long retry_count;
  17. unsigned long max_retry_count;
  18. };
  19. extern struct balloon_stats balloon_stats;
  20. void balloon_set_new_target(unsigned long target);
  21. int alloc_xenballooned_pages(int nr_pages, struct page **pages);
  22. void free_xenballooned_pages(int nr_pages, struct page **pages);
  23. struct device;
  24. #ifdef CONFIG_XEN_SELFBALLOONING
  25. extern int register_xen_selfballooning(struct device *dev);
  26. #else
  27. static inline int register_xen_selfballooning(struct device *dev)
  28. {
  29. return -ENOSYS;
  30. }
  31. #endif