aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/memblock.h
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2015-06-24 19:58:12 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-06-24 20:49:45 -0400
commita3f5bafcc04aaf62990e0cf3ced1cc6d8dc6fe95 (patch)
treeadb288c0bf2cfbd6f40f0036f16a3a87f4f4ca06 /include/linux/memblock.h
parentfc6daaf93151877748f8096af6b3fddb147f22d6 (diff)
mm/memblock: allocate boot time data structures from mirrored memory
Try to allocate all boot time kernel data structures from mirrored memory. If we run out of mirrored memory print warnings, but fall back to using non-mirrored memory to make sure that we still boot. By number of bytes, most of what we allocate at boot time is the page structures. 64 bytes per 4K page on x86_64 ... or about 1.5% of total system memory. For workloads where the bulk of memory is allocated to applications this may represent a useful improvement to system availability since 1.5% of total memory might be a third of the memory allocated to the kernel. Signed-off-by: Tony Luck <tony.luck@intel.com> Cc: Xishi Qiu <qiuxishi@huawei.com> Cc: Hanjun Guo <guohanjun@huawei.com> Cc: Xiexiuqi <xiexiuqi@huawei.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Yinghai Lu <yinghai@kernel.org> Cc: Naoya Horiguchi <nao.horiguchi@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/memblock.h')
-rw-r--r--include/linux/memblock.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/memblock.h b/include/linux/memblock.h
index 7aeec0cb4c27..0215ffd63069 100644
--- a/include/linux/memblock.h
+++ b/include/linux/memblock.h
@@ -24,6 +24,7 @@
24enum { 24enum {
25 MEMBLOCK_NONE = 0x0, /* No special request */ 25 MEMBLOCK_NONE = 0x0, /* No special request */
26 MEMBLOCK_HOTPLUG = 0x1, /* hotpluggable region */ 26 MEMBLOCK_HOTPLUG = 0x1, /* hotpluggable region */
27 MEMBLOCK_MIRROR = 0x2, /* mirrored region */
27}; 28};
28 29
29struct memblock_region { 30struct memblock_region {
@@ -78,6 +79,8 @@ int memblock_reserve(phys_addr_t base, phys_addr_t size);
78void memblock_trim_memory(phys_addr_t align); 79void memblock_trim_memory(phys_addr_t align);
79int memblock_mark_hotplug(phys_addr_t base, phys_addr_t size); 80int memblock_mark_hotplug(phys_addr_t base, phys_addr_t size);
80int memblock_clear_hotplug(phys_addr_t base, phys_addr_t size); 81int memblock_clear_hotplug(phys_addr_t base, phys_addr_t size);
82int memblock_mark_mirror(phys_addr_t base, phys_addr_t size);
83ulong choose_memblock_flags(void);
81 84
82/* Low level functions */ 85/* Low level functions */
83int memblock_add_range(struct memblock_type *type, 86int memblock_add_range(struct memblock_type *type,
@@ -160,6 +163,11 @@ static inline bool movable_node_is_enabled(void)
160} 163}
161#endif 164#endif
162 165
166static inline bool memblock_is_mirror(struct memblock_region *m)
167{
168 return m->flags & MEMBLOCK_MIRROR;
169}
170
163#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP 171#ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP
164int memblock_search_pfn_nid(unsigned long pfn, unsigned long *start_pfn, 172int memblock_search_pfn_nid(unsigned long pfn, unsigned long *start_pfn,
165 unsigned long *end_pfn); 173 unsigned long *end_pfn);