]>
Commit | Line | Data |
---|---|---|
cc90b958 BS |
1 | From: ccoffing@novell.com |
2 | Subject: Expose min/max limits of domain ballooning | |
3 | Patch-mainline: obsolete | |
4 | References: 152667, 184727 | |
5 | ||
6 | jb: Also added this to the sysfs representation. | |
7 | ||
8 | Index: head-2008-11-25/drivers/xen/balloon/balloon.c | |
9 | =================================================================== | |
10 | --- head-2008-11-25.orig/drivers/xen/balloon/balloon.c 2008-11-25 13:33:56.000000000 +0100 | |
11 | +++ head-2008-11-25/drivers/xen/balloon/balloon.c 2008-11-25 13:34:52.000000000 +0100 | |
12 | @@ -194,7 +194,7 @@ static unsigned long current_target(void | |
13 | return target; | |
14 | } | |
15 | ||
16 | -static unsigned long minimum_target(void) | |
17 | +unsigned long balloon_minimum_target(void) | |
18 | { | |
19 | #ifndef CONFIG_XEN | |
20 | #define max_pfn num_physpages | |
21 | @@ -421,7 +421,7 @@ void balloon_set_new_target(unsigned lon | |
22 | { | |
23 | /* No need for lock. Not read-modify-write updates. */ | |
24 | bs.hard_limit = ~0UL; | |
25 | - bs.target_pages = max(target, minimum_target()); | |
26 | + bs.target_pages = max(target, balloon_minimum_target()); | |
27 | schedule_work(&balloon_worker); | |
28 | } | |
29 | ||
30 | @@ -496,11 +496,14 @@ static int balloon_read(char *page, char | |
31 | page, | |
32 | "Current allocation: %8lu kB\n" | |
33 | "Requested target: %8lu kB\n" | |
34 | + "Minimum target: %8lu kB\n" | |
35 | + "Maximum target: %8lu kB\n" | |
36 | "Low-mem balloon: %8lu kB\n" | |
37 | "High-mem balloon: %8lu kB\n" | |
38 | "Driver pages: %8lu kB\n" | |
39 | "Xen hard limit: ", | |
40 | PAGES2KB(bs.current_pages), PAGES2KB(bs.target_pages), | |
41 | + PAGES2KB(balloon_minimum_target()), PAGES2KB(num_physpages), | |
42 | PAGES2KB(bs.balloon_low), PAGES2KB(bs.balloon_high), | |
43 | PAGES2KB(bs.driver_pages)); | |
44 | ||
45 | Index: head-2008-11-25/drivers/xen/balloon/common.h | |
46 | =================================================================== | |
47 | --- head-2008-11-25.orig/drivers/xen/balloon/common.h 2007-06-12 13:13:44.000000000 +0200 | |
48 | +++ head-2008-11-25/drivers/xen/balloon/common.h 2008-11-25 13:34:52.000000000 +0100 | |
49 | @@ -47,6 +47,7 @@ struct balloon_stats { | |
50 | unsigned long balloon_high; | |
51 | }; | |
52 | ||
53 | +extern unsigned long num_physpages; | |
54 | extern struct balloon_stats balloon_stats; | |
55 | #define bs balloon_stats | |
56 | ||
57 | @@ -54,5 +55,6 @@ int balloon_sysfs_init(void); | |
58 | void balloon_sysfs_exit(void); | |
59 | ||
60 | void balloon_set_new_target(unsigned long target); | |
61 | +unsigned long balloon_minimum_target(void); | |
62 | ||
63 | #endif /* __XEN_BALLOON_COMMON_H__ */ | |
64 | Index: head-2008-11-25/drivers/xen/balloon/sysfs.c | |
65 | =================================================================== | |
66 | --- head-2008-11-25.orig/drivers/xen/balloon/sysfs.c 2008-11-25 13:34:32.000000000 +0100 | |
67 | +++ head-2008-11-25/drivers/xen/balloon/sysfs.c 2008-11-25 13:34:52.000000000 +0100 | |
68 | @@ -53,6 +53,8 @@ | |
69 | static SYSDEV_ATTR(name, S_IRUGO, show_##name, NULL) | |
70 | ||
71 | BALLOON_SHOW(current_kb, "%lu\n", PAGES2KB(bs.current_pages)); | |
72 | +BALLOON_SHOW(min_kb, "%lu\n", PAGES2KB(balloon_minimum_target())); | |
73 | +BALLOON_SHOW(max_kb, "%lu\n", PAGES2KB(num_physpages)); | |
74 | BALLOON_SHOW(low_kb, "%lu\n", PAGES2KB(bs.balloon_low)); | |
75 | BALLOON_SHOW(high_kb, "%lu\n", PAGES2KB(bs.balloon_high)); | |
76 | BALLOON_SHOW(hard_limit_kb, | |
77 | @@ -97,6 +99,8 @@ static struct sysdev_attribute *balloon_ | |
78 | ||
79 | static struct attribute *balloon_info_attrs[] = { | |
80 | &attr_current_kb.attr, | |
81 | + &attr_min_kb.attr, | |
82 | + &attr_max_kb.attr, | |
83 | &attr_low_kb.attr, | |
84 | &attr_high_kb.attr, | |
85 | &attr_hard_limit_kb.attr, |