]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/xen/balloon.h
appletalk: Fix potential NULL pointer dereference in unregister_snap_client
[mirror_ubuntu-bionic-kernel.git] / include / xen / balloon.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
803eb047
DDG
2/******************************************************************************
3 * Xen balloon functionality
4 */
5
6#define RETRY_UNLIMITED 0
7
8struct balloon_stats {
9 /* We aim for 'current allocation' == 'target allocation'. */
10 unsigned long current_pages;
11 unsigned long target_pages;
1cf6a6c8 12 unsigned long target_unpopulated;
803eb047
DDG
13 /* Number of pages in high- and low-memory balloons. */
14 unsigned long balloon_low;
15 unsigned long balloon_high;
de5a77d8 16 unsigned long total_pages;
803eb047
DDG
17 unsigned long schedule_delay;
18 unsigned long max_schedule_delay;
19 unsigned long retry_count;
20 unsigned long max_retry_count;
21};
22
23extern struct balloon_stats balloon_stats;
24
25void balloon_set_new_target(unsigned long target);
b6f30679 26
81b286e0 27int alloc_xenballooned_pages(int nr_pages, struct page **pages);
693394b8 28void free_xenballooned_pages(int nr_pages, struct page **pages);
a50777c7 29
07068021 30struct device;
a50777c7 31#ifdef CONFIG_XEN_SELFBALLOONING
07068021 32extern int register_xen_selfballooning(struct device *dev);
a50777c7 33#else
07068021 34static inline int register_xen_selfballooning(struct device *dev)
a50777c7
DM
35{
36 return -ENOSYS;
37}
38#endif
96edd61d
JG
39
40#ifdef CONFIG_XEN_BALLOON
41void xen_balloon_init(void);
42#else
43static inline void xen_balloon_init(void)
44{
45}
46#endif