aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/memory_hotplug.h
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2013-03-17 22:40:50 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-03-17 22:40:50 -0400
commit688d794c4c3f8b08c814381ee2edd3ede5856056 (patch)
treeef680add71e2a9588d07d8b594edbc1b5cd127d7 /include/linux/memory_hotplug.h
parent16142655269aaf580488e074eabfdcf0fb4e3687 (diff)
parenta937536b868b8369b98967929045f1df54234323 (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.h33
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 */
30enum {
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 */
50static inline unsigned zone_span_seqbegin(struct zone *zone) 61static 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);
71extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages); 82extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages);
72extern int add_one_highpage(struct page *page, int pfn, int bad_ppro); 83extern 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 */
74extern int online_pages(unsigned long, unsigned long); 85extern int online_pages(unsigned long, unsigned long, int);
75extern void __offline_isolated_pages(unsigned long, unsigned long); 86extern void __offline_isolated_pages(unsigned long, unsigned long);
76 87
77typedef void (*online_page_callback_t)(struct page *page); 88typedef 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
87extern bool is_pageblock_removable_nolock(struct page *page); 98extern bool is_pageblock_removable_nolock(struct page *page);
99extern 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
178extern void register_page_bootmem_info_node(struct pglist_data *pgdat);
179#else
166static inline void register_page_bootmem_info_node(struct pglist_data *pgdat) 180static inline void register_page_bootmem_info_node(struct pglist_data *pgdat)
167{ 181{
168} 182}
169static inline void put_page_bootmem(struct page *page)
170{
171}
172#else
173extern void register_page_bootmem_info_node(struct pglist_data *pgdat);
174extern void put_page_bootmem(struct page *page);
175#endif 183#endif
184extern void put_page_bootmem(struct page *page);
185extern 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
224extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages); 235extern int is_mem_section_removable(unsigned long pfn, unsigned long nr_pages);
236extern void try_offline_node(int nid);
225 237
226#else 238#else
227static inline int is_mem_section_removable(unsigned long pfn, 239static 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
245static inline void try_offline_node(int nid) {}
232#endif /* CONFIG_MEMORY_HOTREMOVE */ 246#endif /* CONFIG_MEMORY_HOTREMOVE */
233 247
234extern int mem_online_node(int nid); 248extern int mem_online_node(int nid);
@@ -236,7 +250,8 @@ extern int add_memory(int nid, u64 start, u64 size);
236extern int arch_add_memory(int nid, u64 start, u64 size); 250extern int arch_add_memory(int nid, u64 start, u64 size);
237extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages); 251extern int offline_pages(unsigned long start_pfn, unsigned long nr_pages);
238extern int offline_memory_block(struct memory_block *mem); 252extern int offline_memory_block(struct memory_block *mem);
239extern int remove_memory(u64 start, u64 size); 253extern bool is_memblock_offlined(struct memory_block *mem);
254extern int remove_memory(int nid, u64 start, u64 size);
240extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn, 255extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn,
241 int nr_pages); 256 int nr_pages);
242extern void sparse_remove_one_section(struct zone *zone, struct mem_section *ms); 257extern void sparse_remove_one_section(struct zone *zone, struct mem_section *ms);