balloon.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /******************************************************************************
  3. * Xen balloon functionality
  4. */
  5. #ifndef _XEN_BALLOON_H
  6. #define _XEN_BALLOON_H
  7. #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;
  21. };
  22. extern struct balloon_stats balloon_stats;
  23. void balloon_set_new_target(unsigned long target);
  24. int xen_alloc_ballooned_pages(unsigned int nr_pages, struct page **pages);
  25. void xen_free_ballooned_pages(unsigned int nr_pages, struct page **pages);
  26. #ifdef CONFIG_XEN_BALLOON
  27. void xen_balloon_init(void);
  28. #else
  29. static inline void xen_balloon_init(void)
  30. {
  31. }
  32. #endif
  33. #endif /* _XEN_BALLOON_H */