aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Rientjes <rientjes@google.com>2013-04-29 18:08:22 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-29 18:54:37 -0400
commit4edd7ceff0662afde195da6f6c43e7cbe1ed2dc4 (patch)
tree89e53f524dae229f9db490a1e091842302010c21 /include
parentfe74ebb106a5950e82222c8ea258a9c0d7c65f04 (diff)
mm, hotplug: avoid compiling memory hotremove functions when disabled
__remove_pages() is only necessary for CONFIG_MEMORY_HOTREMOVE. PowerPC pseries will return -EOPNOTSUPP if unsupported. Adding an #ifdef causes several other functions it depends on to also become unnecessary, which saves in .text when disabled (it's disabled in most defconfigs besides powerpc, including x86). remove_memory_block() becomes static since it is not referenced outside of drivers/base/memory.c. Build tested on x86 and powerpc with CONFIG_MEMORY_HOTREMOVE both enabled and disabled. Signed-off-by: David Rientjes <rientjes@google.com> Acked-by: Toshi Kani <toshi.kani@hp.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Wen Congyang <wency@cn.fujitsu.com> Cc: Tang Chen <tangchen@cn.fujitsu.com> Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/memory.h3
-rw-r--r--include/linux/memory_hotplug.h4
2 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 0ff6598ee62f..73817af8b480 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -115,9 +115,10 @@ extern void unregister_memory_notifier(struct notifier_block *nb);
115extern int register_memory_isolate_notifier(struct notifier_block *nb); 115extern int register_memory_isolate_notifier(struct notifier_block *nb);
116extern void unregister_memory_isolate_notifier(struct notifier_block *nb); 116extern void unregister_memory_isolate_notifier(struct notifier_block *nb);
117extern int register_new_memory(int, struct mem_section *); 117extern int register_new_memory(int, struct mem_section *);
118#ifdef CONFIG_MEMORY_HOTREMOVE
118extern int unregister_memory_section(struct mem_section *); 119extern int unregister_memory_section(struct mem_section *);
120#endif
119extern int memory_dev_init(void); 121extern int memory_dev_init(void);
120extern int remove_memory_block(unsigned long, struct mem_section *, int);
121extern int memory_notify(unsigned long val, void *v); 122extern int memory_notify(unsigned long val, void *v);
122extern int memory_isolate_notify(unsigned long val, void *v); 123extern int memory_isolate_notify(unsigned long val, void *v);
123extern struct memory_block *find_memory_block_hinted(struct mem_section *, 124extern struct memory_block *find_memory_block_hinted(struct mem_section *,
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index b6a3be7d47bf..3e622c610925 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -97,13 +97,13 @@ extern void __online_page_free(struct page *page);
97#ifdef CONFIG_MEMORY_HOTREMOVE 97#ifdef CONFIG_MEMORY_HOTREMOVE
98extern 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); 99extern int arch_remove_memory(u64 start, u64 size);
100extern int __remove_pages(struct zone *zone, unsigned long start_pfn,
101 unsigned long nr_pages);
100#endif /* CONFIG_MEMORY_HOTREMOVE */ 102#endif /* CONFIG_MEMORY_HOTREMOVE */
101 103
102/* reasonably generic interface to expand the physical pages in a zone */ 104/* reasonably generic interface to expand the physical pages in a zone */
103extern int __add_pages(int nid, struct zone *zone, unsigned long start_pfn, 105extern int __add_pages(int nid, struct zone *zone, unsigned long start_pfn,
104 unsigned long nr_pages); 106 unsigned long nr_pages);
105extern int __remove_pages(struct zone *zone, unsigned long start_pfn,
106 unsigned long nr_pages);
107 107
108#ifdef CONFIG_NUMA 108#ifdef CONFIG_NUMA
109extern int memory_add_physaddr_to_nid(u64 start); 109extern int memory_add_physaddr_to_nid(u64 start);