提交 4792adba 编写于 作者: J Jon Tollefson 提交者: Benjamin Herrenschmidt

powerpc: Don't use a 16G page if beyond mem= limits

If mem= is used on the boot command line to limit memory then the memory block where a 16G page resides may not be available.

Thanks to Michael Ellerman for finding the problem.
Signed-off-by: NJon Tollefson <kniht@linux.vnet.ibm.com>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 71773f03
...@@ -382,8 +382,10 @@ static int __init htab_dt_scan_hugepage_blocks(unsigned long node, ...@@ -382,8 +382,10 @@ static int __init htab_dt_scan_hugepage_blocks(unsigned long node,
printk(KERN_INFO "Huge page(16GB) memory: " printk(KERN_INFO "Huge page(16GB) memory: "
"addr = 0x%lX size = 0x%lX pages = %d\n", "addr = 0x%lX size = 0x%lX pages = %d\n",
phys_addr, block_size, expected_pages); phys_addr, block_size, expected_pages);
lmb_reserve(phys_addr, block_size * expected_pages); if (phys_addr + (16 * GB) <= lmb_end_of_DRAM()) {
add_gpage(phys_addr, block_size, expected_pages); lmb_reserve(phys_addr, block_size * expected_pages);
add_gpage(phys_addr, block_size, expected_pages);
}
return 0; return 0;
} }
#endif /* CONFIG_HUGETLB_PAGE */ #endif /* CONFIG_HUGETLB_PAGE */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册