Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /******************************************************************************
0003  * Xen balloon functionality
0004  */
0005 #ifndef _XEN_BALLOON_H
0006 #define _XEN_BALLOON_H
0007 
0008 #define RETRY_UNLIMITED 0
0009 
0010 struct balloon_stats {
0011     /* We aim for 'current allocation' == 'target allocation'. */
0012     unsigned long current_pages;
0013     unsigned long target_pages;
0014     unsigned long target_unpopulated;
0015     /* Number of pages in high- and low-memory balloons. */
0016     unsigned long balloon_low;
0017     unsigned long balloon_high;
0018     unsigned long total_pages;
0019     unsigned long schedule_delay;
0020     unsigned long max_schedule_delay;
0021     unsigned long retry_count;
0022     unsigned long max_retry_count;
0023 };
0024 
0025 extern struct balloon_stats balloon_stats;
0026 
0027 void balloon_set_new_target(unsigned long target);
0028 
0029 int xen_alloc_ballooned_pages(unsigned int nr_pages, struct page **pages);
0030 void xen_free_ballooned_pages(unsigned int nr_pages, struct page **pages);
0031 
0032 #ifdef CONFIG_XEN_BALLOON
0033 void xen_balloon_init(void);
0034 #else
0035 static inline void xen_balloon_init(void)
0036 {
0037 }
0038 #endif
0039 
0040 #endif  /* _XEN_BALLOON_H */