aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/memory_hotplug.h
diff options
context:
space:
mode:
authorMichal Marek <mmarek@suse.cz>2011-03-09 10:15:44 -0500
committerMichal Marek <mmarek@suse.cz>2011-03-09 10:15:44 -0500
commit2d8ad8719591fa803b0d589ed057fa46f49b7155 (patch)
tree4ae051577dad1161c91dafbf4207bb10a9dc91bb /include/linux/memory_hotplug.h
parent9b4ce7bce5f30712fd926ab4599a803314a07719 (diff)
parentc56eb8fb6dccb83d9fe62fd4dc00c834de9bc470 (diff)
Merge commit 'v2.6.38-rc1' into kbuild/packaging
Diffstat (limited to 'include/linux/memory_hotplug.h')
-rw-r--r--include/linux/memory_hotplug.h31
1 files changed, 26 insertions, 5 deletions
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 35b07b773e6c..8122018d3000 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -13,12 +13,16 @@ struct mem_section;
13#ifdef CONFIG_MEMORY_HOTPLUG 13#ifdef CONFIG_MEMORY_HOTPLUG
14 14
15/* 15/*
16 * Types for free bootmem. 16 * Types for free bootmem stored in page->lru.next. These have to be in
17 * The normal smallest mapcount is -1. Here is smaller value than it. 17 * some random range in unsigned long space for debugging purposes.
18 */ 18 */
19#define SECTION_INFO (-1 - 1) 19enum {
20#define MIX_SECTION_INFO (-1 - 2) 20 MEMORY_HOTPLUG_MIN_BOOTMEM_TYPE = 12,
21#define NODE_INFO (-1 - 3) 21 SECTION_INFO = MEMORY_HOTPLUG_MIN_BOOTMEM_TYPE,
22 MIX_SECTION_INFO,
23 NODE_INFO,
24 MEMORY_HOTPLUG_MAX_BOOTMEM_TYPE = NODE_INFO,
25};
22 26
23/* 27/*
24 * pgdat resizing functions 28 * pgdat resizing functions
@@ -70,6 +74,10 @@ extern void online_page(struct page *page);
70extern int online_pages(unsigned long, unsigned long); 74extern int online_pages(unsigned long, unsigned long);
71extern void __offline_isolated_pages(unsigned long, unsigned long); 75extern void __offline_isolated_pages(unsigned long, unsigned long);
72 76
77#ifdef CONFIG_MEMORY_HOTREMOVE
78extern bool is_pageblock_removable_nolock(struct page *page);
79#endif /* CONFIG_MEMORY_HOTREMOVE */
80
73/* reasonably generic interface to expand the physical pages in a zone */ 81/* reasonably generic interface to expand the physical pages in a zone */
74extern int __add_pages(int nid, struct zone *zone, unsigned long start_pfn, 82extern int __add_pages(int nid, struct zone *zone, unsigned long start_pfn,
75 unsigned long nr_pages); 83 unsigned long nr_pages);
@@ -157,6 +165,15 @@ extern void register_page_bootmem_info_node(struct pglist_data *pgdat);
157extern void put_page_bootmem(struct page *page); 165extern void put_page_bootmem(struct page *page);
158#endif 166#endif
159 167
168/*
169 * Lock for memory hotplug guarantees 1) all callbacks for memory hotplug
170 * notifier will be called under this. 2) offline/online/add/remove memory
171 * will not run simultaneously.
172 */
173
174void lock_memory_hotplug(void);
175void unlock_memory_hotplug(void);
176
160#else /* ! CONFIG_MEMORY_HOTPLUG */ 177#else /* ! CONFIG_MEMORY_HOTPLUG */
161/* 178/*
162 * Stub functions for when hotplug is off 179 * Stub functions for when hotplug is off
@@ -188,6 +205,9 @@ static inline void register_page_bootmem_info_node(struct pglist_data *pgdat)
188{ 205{
189} 206}
190 207
208static inline void lock_memory_hotplug(void) {}
209static inline void unlock_memory_hotplug(void) {}
210
191#endif /* ! CONFIG_MEMORY_HOTPLUG */ 211#endif /* ! CONFIG_MEMORY_HOTPLUG */
192 212
193#ifdef CONFIG_MEMORY_HOTREMOVE 213#ifdef CONFIG_MEMORY_HOTREMOVE
@@ -202,6 +222,7 @@ static inline int is_mem_section_removable(unsigned long pfn,
202} 222}
203#endif /* CONFIG_MEMORY_HOTREMOVE */ 223#endif /* CONFIG_MEMORY_HOTREMOVE */
204 224
225extern int mem_online_node(int nid);
205extern int add_memory(int nid, u64 start, u64 size); 226extern int add_memory(int nid, u64 start, u64 size);
206extern int arch_add_memory(int nid, u64 start, u64 size); 227extern int arch_add_memory(int nid, u64 start, u64 size);
207extern int remove_memory(u64 start, u64 size); 228extern int remove_memory(u64 start, u64 size);