aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/memory_hotplug.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/memory_hotplug.h')
-rw-r--r--include/linux/memory_hotplug.h26
1 files changed, 21 insertions, 5 deletions
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 4307231bd22f..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
@@ -161,6 +165,15 @@ extern void register_page_bootmem_info_node(struct pglist_data *pgdat);
161extern void put_page_bootmem(struct page *page); 165extern void put_page_bootmem(struct page *page);
162#endif 166#endif
163 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
164#else /* ! CONFIG_MEMORY_HOTPLUG */ 177#else /* ! CONFIG_MEMORY_HOTPLUG */
165/* 178/*
166 * Stub functions for when hotplug is off 179 * Stub functions for when hotplug is off
@@ -192,6 +205,9 @@ static inline void register_page_bootmem_info_node(struct pglist_data *pgdat)
192{ 205{
193} 206}
194 207
208static inline void lock_memory_hotplug(void) {}
209static inline void unlock_memory_hotplug(void) {}
210
195#endif /* ! CONFIG_MEMORY_HOTPLUG */ 211#endif /* ! CONFIG_MEMORY_HOTPLUG */
196 212
197#ifdef CONFIG_MEMORY_HOTREMOVE 213#ifdef CONFIG_MEMORY_HOTREMOVE