]>
Commit | Line | Data |
---|---|---|
2cb7cef9 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 | --- sle11-2009-06-29.orig/drivers/xen/balloon/balloon.c 2009-06-29 15:30:29.000000000 +0200 | |
9 | +++ sle11-2009-06-29/drivers/xen/balloon/balloon.c 2009-06-29 15:44:49.000000000 +0200 | |
10 | @@ -194,7 +194,7 @@ static unsigned long current_target(void | |
11 | return target; | |
12 | } | |
13 | ||
14 | -static unsigned long minimum_target(void) | |
15 | +unsigned long balloon_minimum_target(void) | |
16 | { | |
17 | #ifndef CONFIG_XEN | |
18 | #define max_pfn num_physpages | |
19 | @@ -406,7 +406,7 @@ static void balloon_process(struct work_ | |
20 | void balloon_set_new_target(unsigned long target) | |
21 | { | |
22 | /* No need for lock. Not read-modify-write updates. */ | |
23 | - bs.target_pages = max(target, minimum_target()); | |
24 | + bs.target_pages = max(target, balloon_minimum_target()); | |
25 | schedule_work(&balloon_worker); | |
26 | } | |
27 | ||
28 | @@ -481,10 +481,13 @@ static int balloon_read(char *page, char | |
29 | page, | |
30 | "Current allocation: %8lu kB\n" | |
31 | "Requested target: %8lu kB\n" | |
32 | + "Minimum target: %8lu kB\n" | |
33 | + "Maximum target: %8lu kB\n" | |
34 | "Low-mem balloon: %8lu kB\n" | |
35 | "High-mem balloon: %8lu kB\n" | |
36 | "Driver pages: %8lu kB\n", | |
37 | PAGES2KB(bs.current_pages), PAGES2KB(bs.target_pages), | |
38 | + PAGES2KB(balloon_minimum_target()), PAGES2KB(num_physpages), | |
39 | PAGES2KB(bs.balloon_low), PAGES2KB(bs.balloon_high), | |
40 | PAGES2KB(bs.driver_pages)); | |
41 | ||
42 | --- sle11-2009-06-29.orig/drivers/xen/balloon/common.h 2009-06-29 15:24:00.000000000 +0200 | |
43 | +++ sle11-2009-06-29/drivers/xen/balloon/common.h 2009-06-29 15:43:29.000000000 +0200 | |
44 | @@ -52,5 +52,6 @@ int balloon_sysfs_init(void); | |
45 | void balloon_sysfs_exit(void); | |
46 | ||
47 | void balloon_set_new_target(unsigned long target); | |
48 | +unsigned long balloon_minimum_target(void); | |
49 | ||
50 | #endif /* __XEN_BALLOON_COMMON_H__ */ | |
51 | --- sle11-2009-06-29.orig/drivers/xen/balloon/sysfs.c 2009-06-29 15:31:06.000000000 +0200 | |
52 | +++ sle11-2009-06-29/drivers/xen/balloon/sysfs.c 2009-06-29 15:43:35.000000000 +0200 | |
53 | @@ -31,6 +31,7 @@ | |
54 | #include <linux/capability.h> | |
55 | #include <linux/errno.h> | |
56 | #include <linux/init.h> | |
57 | +#include <linux/mm.h> | |
58 | #include <linux/stat.h> | |
59 | #include <linux/string.h> | |
60 | #include <linux/sysdev.h> | |
61 | @@ -53,6 +54,8 @@ | |
62 | static SYSDEV_ATTR(name, S_IRUGO, show_##name, NULL) | |
63 | ||
64 | BALLOON_SHOW(current_kb, "%lu\n", PAGES2KB(bs.current_pages)); | |
65 | +BALLOON_SHOW(min_kb, "%lu\n", PAGES2KB(balloon_minimum_target())); | |
66 | +BALLOON_SHOW(max_kb, "%lu\n", PAGES2KB(num_physpages)); | |
67 | BALLOON_SHOW(low_kb, "%lu\n", PAGES2KB(bs.balloon_low)); | |
68 | BALLOON_SHOW(high_kb, "%lu\n", PAGES2KB(bs.balloon_high)); | |
69 | BALLOON_SHOW(driver_kb, "%lu\n", PAGES2KB(bs.driver_pages)); | |
70 | @@ -94,6 +97,8 @@ static struct sysdev_attribute *balloon_ | |
71 | ||
72 | static struct attribute *balloon_info_attrs[] = { | |
73 | &attr_current_kb.attr, | |
74 | + &attr_min_kb.attr, | |
75 | + &attr_max_kb.attr, | |
76 | &attr_low_kb.attr, | |
77 | &attr_high_kb.attr, | |
78 | &attr_driver_kb.attr, |