diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-03-17 22:40:50 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-03-17 22:40:50 -0400 |
| commit | 688d794c4c3f8b08c814381ee2edd3ede5856056 (patch) | |
| tree | ef680add71e2a9588d07d8b594edbc1b5cd127d7 /include/linux/memory_hotplug.h | |
| parent | 16142655269aaf580488e074eabfdcf0fb4e3687 (diff) | |
| parent | a937536b868b8369b98967929045f1df54234323 (diff) | |
Merge tag 'v3.9-rc3' into next
Merge with mainline to bring in module_platform_driver_probe() and
devm_ioremap_resource().
Diffstat (limited to 'include/linux/memory_hotplug.h')
| -rw-r--r-- | include/linux/memory_hotplug.h | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 95573ec4ee6c..b6a3be7d47bf 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
| @@ -26,6 +26,13 @@ enum { | |||
| 26 | MEMORY_HOTPLUG_MAX_BOOTMEM_TYPE = NODE_INFO, | 26 | MEMORY_HOTPLUG_MAX_BOOTMEM_TYPE = NODE_INFO, |
| 27 | }; | 27 | }; |
| 28 | 28 | ||
| 29 | /* Types for control the zone type of onlined memory */ | ||
| 30 | enum { | ||
| 31 | ONLINE_KEEP, | ||
| 32 | ONLINE_KERNEL, | ||
| 33 | ONLINE_MOVABLE, | ||
| 34 | }; | ||
| 35 | |||
| 29 | /* | 36 | /* |
| 30 | * pgdat resizing functions | 37 | * pgdat resizing functions |
| 31 | */ | 38 | */ |
| @@ -46,6 +53,10 @@ void pgdat_resize_init(struct pglist_data *pgdat) | |||
| 46 | } | 53 | } |
| 47 | /* | 54 | /* |
| 48 | * Zone resizing functions | 55 | * Zone resizing functions |
| 56 | * | ||
| 57 | * Note: any attempt to resize a zone should has pgdat_resize_lock() | ||
| 58 | * zone_span_writelock() both held. This ensure the size of a zone | ||
| 59 | * can't be changed while pgdat_resize_lock() held. | ||
| 49 | */ | 60 | */ |
| 50 | static inline unsigned zone_span_seqbegin(struct zone *zone) | 61 | static inline unsigned zone_span_seqbegin(struct zone *zone) |
| 51 | { | 62 | { |
| @@ -71,7 +82,7 @@ extern int zone_grow_free_lists(struct zone *zone, unsigned long new_nr_pages); | |||
| 71 | extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages); | 82 | extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages); |
| 72 | extern int add_one_highpage(struct page *page, int pfn, int bad_ppro); | 83 | extern int add_one_highpage(struct page *page, int pfn, int bad_ppro); |
| 73 | /* VM interface that may be used by firmware interface */ | 84 | /* VM interface that may be used by firmware interface */ |
| 74 | extern int online_pages(unsigned long, unsigned long); | 85 | extern int online_pages(unsigned long, unsigned long, int); |
| 75 | extern void __offline_isolated_pages(unsigned long, unsigned long); | 86 | extern void __offline_isolated_pages(unsigned long, unsigned long); |
| 76 | 87 | ||
| 77 | typedef void (*online_page_callback_t)(struct page *page); | 88 | typedef void (*online_page_callback_t)(struct page *page); |
| @@ -85,6 +96,7 @@ extern void __online_page_free(struct page *page); | |||
| 85 | 96 | ||
| 86 | #ifdef CONFIG_MEMORY_HOTREMOVE | 97 | #ifdef CONFIG_MEMORY_HOTREMOVE |
| 87 | extern bool is_pageblock_removable_nolock(struct page *page); | 98 | extern bool is_pageblock_removable_nolock(struct page *page); |
| 99 | extern int arch_remove_memory(u64 start, u64 size); | ||
| 88 | #endif /* CONFIG_MEMORY_HOTREMOVE */ | 100 | #endif /* CONFIG_MEMORY_HOTREMOVE */ |
| 89 | 101 | ||
| 90 | /* reasonably generic interface to expand the physical pages in a zone */ | 102 | /* reasonably generic interface to expand the physical pages in a zone */ |
| @@ -162,17 +174,16 @@ static inline void arch_refresh_nodedata(int nid, pg_data_t *pgdat) | |||
| 162 | #endif /* CONFIG_NUMA */ | 174 | #endif /* CONFIG_NUMA */ |
| 163 | #endif /* CONFIG_HAVE_ARCH_NODEDATA_EXTENSION */ | 175 | #endif /* CONFIG_HAVE_ARCH_NODEDATA_EXTENSION */ |
| 164 | 176 | ||
| 165 | #ifdef CONFIG_SPARSEMEM_VMEMMAP | 177 | #ifdef CONFIG_HAVE_BOOTMEM_INFO_NODE |
| 178 | extern void register_page_bootmem_info_node(struct pglist_data *pgdat); | ||
| 179 | #else | ||
| 166 | static inline void register_page_bootmem_info_node(struct pglist_data *pgdat) | 180 | static inline void register_page_bootmem_info_node(struct pglist_data *pgdat) |
| 167 | { | 181 | { |
| 168 | } | 182 | } |
| 169 | static inline void put_page_bootmem(struct page *page) | ||
| 170 | { | ||
| 171 | } | ||
| 172 | #else | ||
| 173 | extern void register_page_bootmem_info_node(struct pglist_data *pgdat); | ||
| 174 | extern void put_page_bootmem(struct page *page); | ||
| 175 | #endif | 183 | #endif |
| 184 | extern void put_page_bootmem(struct page *page); | ||
| 185 | extern void get_page_bootmem(unsigned long ingo, struct page *page, | ||
| 186 | unsigned long type); | ||
| 176 | 187 | ||
| 177 | /* | 188 | /* |
| 178 | * Lock for memory hotplug guarantees 1) all callbacks for memory hotplug | 189 | * Lock for memory hotplug guarantees 1) all callbacks for memory hotplug |
| @@ -222,6 +233,7 @@ static inline void unlock_memory_hotplug(void) {} | |||
| 222 | #ifdef CONFIG_MEMORY_HOTREMOVE | 233 | #ifdef CONFIG_MEMORY_HOTREMOVE |
| 223 | 234 | ||
| 224 | extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages); | 235 | extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages); |
| 236 | extern void try_offline_node(int nid); | ||
| 225 | 237 | ||
| 226 | #else | 238 | #else |
| 227 | static inline int is_mem_section_removable(unsigned long pfn, | 239 | static inline int is_mem_section_removable(unsigned long pfn, |
| @@ -229,6 +241,8 @@ static inline int is_mem_section_removable(unsigned long pfn, | |||
| 229 | { | 241 | { |
| 230 | return 0; | 242 | return 0; |
| 231 | } | 243 | } |
| 244 | |||
| 245 | static inline void try_offline_node(int nid) {} | ||
| 232 | #endif /* CONFIG_MEMORY_HOTREMOVE */ | 246 | #endif /* CONFIG_MEMORY_HOTREMOVE */ |
| 233 | 247 | ||
| 234 | extern int mem_online_node(int nid); | 248 | extern int mem_online_node(int nid); |
| @@ -236,7 +250,8 @@ extern int add_memory(int nid, u64 start, u64 size); | |||
| 236 | extern int arch_add_memory(int nid, u64 start, u64 size); | 250 | extern int arch_add_memory(int nid, u64 start, u64 size); |
| 237 | extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages); | 251 | extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages); |
| 238 | extern int offline_memory_block(struct memory_block *mem); | 252 | extern int offline_memory_block(struct memory_block *mem); |
| 239 | extern int remove_memory(u64 start, u64 size); | 253 | extern bool is_memblock_offlined(struct memory_block *mem); |
| 254 | extern int remove_memory(int nid, u64 start, u64 size); | ||
| 240 | extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn, | 255 | extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn, |
| 241 | int nr_pages); | 256 | int nr_pages); |
| 242 | extern void sparse_remove_one_section(struct zone *zone, struct mem_section *ms); | 257 | extern void sparse_remove_one_section(struct zone *zone, struct mem_section *ms); |
