diff options
| author | Michal Marek <mmarek@suse.cz> | 2011-03-09 10:15:44 -0500 |
|---|---|---|
| committer | Michal Marek <mmarek@suse.cz> | 2011-03-09 10:15:44 -0500 |
| commit | 2d8ad8719591fa803b0d589ed057fa46f49b7155 (patch) | |
| tree | 4ae051577dad1161c91dafbf4207bb10a9dc91bb /include/linux/memory_hotplug.h | |
| parent | 9b4ce7bce5f30712fd926ab4599a803314a07719 (diff) | |
| parent | c56eb8fb6dccb83d9fe62fd4dc00c834de9bc470 (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.h | 31 |
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) | 19 | enum { |
| 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); | |||
| 70 | extern int online_pages(unsigned long, unsigned long); | 74 | extern int online_pages(unsigned long, unsigned long); |
| 71 | extern void __offline_isolated_pages(unsigned long, unsigned long); | 75 | extern void __offline_isolated_pages(unsigned long, unsigned long); |
| 72 | 76 | ||
| 77 | #ifdef CONFIG_MEMORY_HOTREMOVE | ||
| 78 | extern 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 */ |
| 74 | extern int __add_pages(int nid, struct zone *zone, unsigned long start_pfn, | 82 | extern 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); | |||
| 157 | extern void put_page_bootmem(struct page *page); | 165 | extern 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 | |||
| 174 | void lock_memory_hotplug(void); | ||
| 175 | void 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 | ||
| 208 | static inline void lock_memory_hotplug(void) {} | ||
| 209 | static 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 | ||
| 225 | extern int mem_online_node(int nid); | ||
| 205 | extern int add_memory(int nid, u64 start, u64 size); | 226 | extern int add_memory(int nid, u64 start, u64 size); |
| 206 | extern int arch_add_memory(int nid, u64 start, u64 size); | 227 | extern int arch_add_memory(int nid, u64 start, u64 size); |
| 207 | extern int remove_memory(u64 start, u64 size); | 228 | extern int remove_memory(u64 start, u64 size); |
