sparse.c (756a025f00091918d9d09ca3229defb160b409c0) | sparse.c (1170532bb49f9468aedabdc1d5a560e2521a2bcc) |
---|---|
1/* 2 * sparse memory mappings. 3 */ 4#include <linux/mm.h> 5#include <linux/slab.h> 6#include <linux/mmzone.h> 7#include <linux/bootmem.h> 8#include <linux/compiler.h> --- 299 unchanged lines hidden (view full) --- 308 /* skip redundant message */ 309 return; 310 311 old_usemap_snr = usemap_snr; 312 old_pgdat_snr = pgdat_snr; 313 314 usemap_nid = sparse_early_nid(__nr_to_section(usemap_snr)); 315 if (usemap_nid != nid) { | 1/* 2 * sparse memory mappings. 3 */ 4#include <linux/mm.h> 5#include <linux/slab.h> 6#include <linux/mmzone.h> 7#include <linux/bootmem.h> 8#include <linux/compiler.h> --- 299 unchanged lines hidden (view full) --- 308 /* skip redundant message */ 309 return; 310 311 old_usemap_snr = usemap_snr; 312 old_pgdat_snr = pgdat_snr; 313 314 usemap_nid = sparse_early_nid(__nr_to_section(usemap_snr)); 315 if (usemap_nid != nid) { |
316 printk(KERN_INFO 317 "node %d must be removed before remove section %ld\n", 318 nid, usemap_snr); | 316 pr_info("node %d must be removed before remove section %ld\n", 317 nid, usemap_snr); |
319 return; 320 } 321 /* 322 * There is a circular dependency. 323 * Some platforms allow un-removable section because they will just 324 * gather other removable sections for dynamic partitioning. 325 * Just notify un-removable section's number here. 326 */ | 318 return; 319 } 320 /* 321 * There is a circular dependency. 322 * Some platforms allow un-removable section because they will just 323 * gather other removable sections for dynamic partitioning. 324 * Just notify un-removable section's number here. 325 */ |
327 printk(KERN_INFO "Section %ld and %ld (node %d)", usemap_snr, 328 pgdat_snr, nid); 329 printk(KERN_CONT 330 " have a circular dependency on usemap and pgdat allocations\n"); | 326 pr_info("Section %ld and %ld (node %d) have a circular dependency on usemap and pgdat allocations\n", 327 usemap_snr, pgdat_snr, nid); |
331} 332#else 333static unsigned long * __init 334sparse_early_usemaps_alloc_pgdat_section(struct pglist_data *pgdat, 335 unsigned long size) 336{ 337 return memblock_virt_alloc_node_nopanic(size, pgdat->node_id); 338} --- 11 unchanged lines hidden (view full) --- 350 void *usemap; 351 unsigned long pnum; 352 unsigned long **usemap_map = (unsigned long **)data; 353 int size = usemap_size(); 354 355 usemap = sparse_early_usemaps_alloc_pgdat_section(NODE_DATA(nodeid), 356 size * usemap_count); 357 if (!usemap) { | 328} 329#else 330static unsigned long * __init 331sparse_early_usemaps_alloc_pgdat_section(struct pglist_data *pgdat, 332 unsigned long size) 333{ 334 return memblock_virt_alloc_node_nopanic(size, pgdat->node_id); 335} --- 11 unchanged lines hidden (view full) --- 347 void *usemap; 348 unsigned long pnum; 349 unsigned long **usemap_map = (unsigned long **)data; 350 int size = usemap_size(); 351 352 usemap = sparse_early_usemaps_alloc_pgdat_section(NODE_DATA(nodeid), 353 size * usemap_count); 354 if (!usemap) { |
358 printk(KERN_WARNING "%s: allocation failed\n", __func__); | 355 pr_warn("%s: allocation failed\n", __func__); |
359 return; 360 } 361 362 for (pnum = pnum_begin; pnum < pnum_end; pnum++) { 363 if (!present_section_nr(pnum)) 364 continue; 365 usemap_map[pnum] = usemap; 366 usemap += size; --- 56 unchanged lines hidden (view full) --- 423 struct mem_section *ms; 424 425 if (!present_section_nr(pnum)) 426 continue; 427 map_map[pnum] = sparse_mem_map_populate(pnum, nodeid); 428 if (map_map[pnum]) 429 continue; 430 ms = __nr_to_section(pnum); | 356 return; 357 } 358 359 for (pnum = pnum_begin; pnum < pnum_end; pnum++) { 360 if (!present_section_nr(pnum)) 361 continue; 362 usemap_map[pnum] = usemap; 363 usemap += size; --- 56 unchanged lines hidden (view full) --- 420 struct mem_section *ms; 421 422 if (!present_section_nr(pnum)) 423 continue; 424 map_map[pnum] = sparse_mem_map_populate(pnum, nodeid); 425 if (map_map[pnum]) 426 continue; 427 ms = __nr_to_section(pnum); |
431 printk(KERN_ERR "%s: sparsemem memory map backing failed some memory will not be available.\n", | 428 pr_err("%s: sparsemem memory map backing failed some memory will not be available\n", |
432 __func__); 433 ms->section_mem_map = 0; 434 } 435} 436#endif /* !CONFIG_SPARSEMEM_VMEMMAP */ 437 438#ifdef CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER 439static void __init sparse_early_mem_maps_alloc_node(void *data, --- 11 unchanged lines hidden (view full) --- 451 struct page *map; 452 struct mem_section *ms = __nr_to_section(pnum); 453 int nid = sparse_early_nid(ms); 454 455 map = sparse_mem_map_populate(pnum, nid); 456 if (map) 457 return map; 458 | 429 __func__); 430 ms->section_mem_map = 0; 431 } 432} 433#endif /* !CONFIG_SPARSEMEM_VMEMMAP */ 434 435#ifdef CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER 436static void __init sparse_early_mem_maps_alloc_node(void *data, --- 11 unchanged lines hidden (view full) --- 448 struct page *map; 449 struct mem_section *ms = __nr_to_section(pnum); 450 int nid = sparse_early_nid(ms); 451 452 map = sparse_mem_map_populate(pnum, nid); 453 if (map) 454 return map; 455 |
459 printk(KERN_ERR "%s: sparsemem memory map backing failed some memory will not be available.\n", | 456 pr_err("%s: sparsemem memory map backing failed some memory will not be available\n", |
460 __func__); 461 ms->section_mem_map = 0; 462 return NULL; 463} 464#endif 465 466void __weak __meminit vmemmap_populate_print_last(void) 467{ --- 346 unchanged lines hidden --- | 457 __func__); 458 ms->section_mem_map = 0; 459 return NULL; 460} 461#endif 462 463void __weak __meminit vmemmap_populate_print_last(void) 464{ --- 346 unchanged lines hidden --- |