diff options
author | Yinghai Lu <yhlu.kernel.send@gmail.com> | 2008-04-12 04:19:24 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-26 16:51:09 -0400 |
commit | c2b91e2eec9678dbda274e906cc32ea8f711da3b (patch) | |
tree | fd9e9799078c65c8282ca3a996e6c3bd9e94fa4c | |
parent | 1a27fc0a42162964d758e9d36d2d1b49c082a67c (diff) |
x86_64/mm: check and print vmemmap allocation continuous
On big systems with lots of memory, don't print out too much during
bootup, and make it easy to find if it is continuous.
on 256G 8 sockets system will get
[ffffe20000000000-ffffe20002bfffff] PMD -> [ffff810001400000-ffff810003ffffff] on node 0
[ffffe2001c700000-ffffe2001c7fffff] potential offnode page_structs
[ffffe20002c00000-ffffe2001c7fffff] PMD -> [ffff81000c000000-ffff8100255fffff] on node 0
[ffffe20038700000-ffffe200387fffff] potential offnode page_structs
[ffffe2001c800000-ffffe200387fffff] PMD -> [ffff810820200000-ffff81083c1fffff] on node 1
[ffffe20040000000-ffffe2007fffffff] PUD ->ffff811027a00000 on node 2
[ffffe20038800000-ffffe2003fffffff] PMD -> [ffff811020200000-ffff8110279fffff] on node 2
[ffffe20054700000-ffffe200547fffff] potential offnode page_structs
[ffffe20040000000-ffffe200547fffff] PMD -> [ffff811027c00000-ffff81103c3fffff] on node 2
[ffffe20070700000-ffffe200707fffff] potential offnode page_structs
[ffffe20054800000-ffffe200707fffff] PMD -> [ffff811820200000-ffff81183c1fffff] on node 3
[ffffe20080000000-ffffe200bfffffff] PUD ->ffff81202fa00000 on node 4
[ffffe20070800000-ffffe2007fffffff] PMD -> [ffff812020200000-ffff81202f9fffff] on node 4
[ffffe2008c700000-ffffe2008c7fffff] potential offnode page_structs
[ffffe20080000000-ffffe2008c7fffff] PMD -> [ffff81202fc00000-ffff81203c3fffff] on node 4
[ffffe200a8700000-ffffe200a87fffff] potential offnode page_structs
[ffffe2008c800000-ffffe200a87fffff] PMD -> [ffff812820200000-ffff81283c1fffff] on node 5
[ffffe200c0000000-ffffe200ffffffff] PUD ->ffff813037a00000 on node 6
[ffffe200a8800000-ffffe200bfffffff] PMD -> [ffff813020200000-ffff8130379fffff] on node 6
[ffffe200c4700000-ffffe200c47fffff] potential offnode page_structs
[ffffe200c0000000-ffffe200c47fffff] PMD -> [ffff813037c00000-ffff81303c3fffff] on node 6
[ffffe200c4800000-ffffe200e07fffff] PMD -> [ffff813820200000-ffff81383c1fffff] on node 7
instead of a very long print out...
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | arch/x86/mm/init_64.c | 28 | ||||
-rw-r--r-- | include/linux/mm.h | 1 | ||||
-rw-r--r-- | mm/sparse.c | 5 |
3 files changed, 32 insertions, 2 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 7dc4fbc2d6b0..5fbb8652cf59 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -932,6 +932,10 @@ const char *arch_vma_name(struct vm_area_struct *vma) | |||
932 | /* | 932 | /* |
933 | * Initialise the sparsemem vmemmap using huge-pages at the PMD level. | 933 | * Initialise the sparsemem vmemmap using huge-pages at the PMD level. |
934 | */ | 934 | */ |
935 | static long __meminitdata addr_start, addr_end; | ||
936 | static void __meminitdata *p_start, *p_end; | ||
937 | static int __meminitdata node_start; | ||
938 | |||
935 | int __meminit | 939 | int __meminit |
936 | vmemmap_populate(struct page *start_page, unsigned long size, int node) | 940 | vmemmap_populate(struct page *start_page, unsigned long size, int node) |
937 | { | 941 | { |
@@ -966,12 +970,32 @@ vmemmap_populate(struct page *start_page, unsigned long size, int node) | |||
966 | PAGE_KERNEL_LARGE); | 970 | PAGE_KERNEL_LARGE); |
967 | set_pmd(pmd, __pmd(pte_val(entry))); | 971 | set_pmd(pmd, __pmd(pte_val(entry))); |
968 | 972 | ||
969 | printk(KERN_DEBUG " [%lx-%lx] PMD ->%p on node %d\n", | 973 | /* check to see if we have contiguous blocks */ |
970 | addr, addr + PMD_SIZE - 1, p, node); | 974 | if (p_end != p || node_start != node) { |
975 | if (p_start) | ||
976 | printk(KERN_DEBUG " [%lx-%lx] PMD -> [%p-%p] on node %d\n", | ||
977 | addr_start, addr_end-1, p_start, p_end-1, node_start); | ||
978 | addr_start = addr; | ||
979 | node_start = node; | ||
980 | p_start = p; | ||
981 | } | ||
982 | addr_end = addr + PMD_SIZE; | ||
983 | p_end = p + PMD_SIZE; | ||
971 | } else { | 984 | } else { |
972 | vmemmap_verify((pte_t *)pmd, node, addr, next); | 985 | vmemmap_verify((pte_t *)pmd, node, addr, next); |
973 | } | 986 | } |
974 | } | 987 | } |
975 | return 0; | 988 | return 0; |
976 | } | 989 | } |
990 | |||
991 | void __meminit vmemmap_populate_print_last(void) | ||
992 | { | ||
993 | if (p_start) { | ||
994 | printk(KERN_DEBUG " [%lx-%lx] PMD -> [%p-%p] on node %d\n", | ||
995 | addr_start, addr_end-1, p_start, p_end-1, node_start); | ||
996 | p_start = NULL; | ||
997 | p_end = NULL; | ||
998 | node_start = 0; | ||
999 | } | ||
1000 | } | ||
977 | #endif | 1001 | #endif |
diff --git a/include/linux/mm.h b/include/linux/mm.h index b695875d63e3..286d31521605 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1229,6 +1229,7 @@ void vmemmap_verify(pte_t *, int, unsigned long, unsigned long); | |||
1229 | int vmemmap_populate_basepages(struct page *start_page, | 1229 | int vmemmap_populate_basepages(struct page *start_page, |
1230 | unsigned long pages, int node); | 1230 | unsigned long pages, int node); |
1231 | int vmemmap_populate(struct page *start_page, unsigned long pages, int node); | 1231 | int vmemmap_populate(struct page *start_page, unsigned long pages, int node); |
1232 | void vmemmap_populate_print_last(void); | ||
1232 | 1233 | ||
1233 | #endif /* __KERNEL__ */ | 1234 | #endif /* __KERNEL__ */ |
1234 | #endif /* _LINUX_MM_H */ | 1235 | #endif /* _LINUX_MM_H */ |
diff --git a/mm/sparse.c b/mm/sparse.c index 458109b99e61..7e9191381f86 100644 --- a/mm/sparse.c +++ b/mm/sparse.c | |||
@@ -295,6 +295,9 @@ struct page __init *sparse_early_mem_map_alloc(unsigned long pnum) | |||
295 | return NULL; | 295 | return NULL; |
296 | } | 296 | } |
297 | 297 | ||
298 | void __attribute__((weak)) __meminit vmemmap_populate_print_last(void) | ||
299 | { | ||
300 | } | ||
298 | /* | 301 | /* |
299 | * Allocate the accumulated non-linear sections, allocate a mem_map | 302 | * Allocate the accumulated non-linear sections, allocate a mem_map |
300 | * for each and record the physical to section mapping. | 303 | * for each and record the physical to section mapping. |
@@ -345,6 +348,8 @@ void __init sparse_init(void) | |||
345 | usemap); | 348 | usemap); |
346 | } | 349 | } |
347 | 350 | ||
351 | vmemmap_populate_print_last(); | ||
352 | |||
348 | free_bootmem(__pa(usemap_map), size); | 353 | free_bootmem(__pa(usemap_map), size); |
349 | } | 354 | } |
350 | 355 | ||