Lines Matching refs:nid
52 static void set_section_nid(unsigned long section_nr, int nid) in set_section_nid() argument
54 section_to_node_table[section_nr] = nid; in set_section_nid()
57 static inline void set_section_nid(unsigned long section_nr, int nid) in set_section_nid() argument
63 static noinline struct mem_section __ref *sparse_index_alloc(int nid) in sparse_index_alloc() argument
70 section = kzalloc_node(array_size, GFP_KERNEL, nid); in sparse_index_alloc()
73 nid); in sparse_index_alloc()
76 __func__, array_size, nid); in sparse_index_alloc()
82 static int __meminit sparse_index_init(unsigned long section_nr, int nid) in sparse_index_init() argument
97 section = sparse_index_alloc(nid); in sparse_index_init()
106 static inline int sparse_index_init(unsigned long section_nr, int nid) in sparse_index_init() argument
118 static inline unsigned long sparse_encode_early_nid(int nid) in sparse_encode_early_nid() argument
120 return ((unsigned long)nid << SECTION_NID_SHIFT); in sparse_encode_early_nid()
226 static void __init memory_present(int nid, unsigned long start, unsigned long end) in memory_present() argument
249 sparse_index_init(section, nid); in memory_present()
250 set_section_nid(section, nid); in memory_present()
254 ms->section_mem_map = sparse_encode_early_nid(nid) | in memory_present()
269 int i, nid; in memblocks_present() local
271 for_each_mem_pfn_range(i, MAX_NUMNODES, &start, &end, &nid) in memblocks_present()
272 memory_present(nid, start, end); in memblocks_present()
338 int nid; in sparse_early_usemaps_alloc_pgdat_section() local
351 nid = early_pfn_to_nid(goal >> PAGE_SHIFT); in sparse_early_usemaps_alloc_pgdat_section()
353 usage = memblock_alloc_try_nid(size, SMP_CACHE_BYTES, goal, limit, nid); in sparse_early_usemaps_alloc_pgdat_section()
361 static void __init check_usemap_section_nr(int nid, in check_usemap_section_nr() argument
367 struct pglist_data *pgdat = NODE_DATA(nid); in check_usemap_section_nr()
389 if (usemap_nid != nid) { in check_usemap_section_nr()
391 nid, usemap_snr); in check_usemap_section_nr()
401 usemap_snr, pgdat_snr, nid); in check_usemap_section_nr()
411 static void __init check_usemap_section_nr(int nid, in check_usemap_section_nr() argument
430 unsigned long nr_pages, int nid, struct vmem_altmap *altmap) in __populate_section_memmap() argument
439 map = memmap_alloc(size, size, addr, nid, false); in __populate_section_memmap()
442 __func__, size, PAGE_SIZE, nid, &addr); in __populate_section_memmap()
457 static void __init sparse_buffer_init(unsigned long size, int nid) in sparse_buffer_init() argument
466 sparsemap_buf = memmap_alloc(size, section_map_size(), addr, nid, true); in sparse_buffer_init()
505 static void __init sparse_init_nid(int nid, unsigned long pnum_begin, in sparse_init_nid() argument
513 usage = sparse_early_usemaps_alloc_pgdat_section(NODE_DATA(nid), in sparse_init_nid()
516 pr_err("%s: node[%d] usemap allocation failed", __func__, nid); in sparse_init_nid()
519 sparse_buffer_init(map_count * section_map_size(), nid); in sparse_init_nid()
527 nid, NULL); in sparse_init_nid()
530 __func__, nid); in sparse_init_nid()
535 check_usemap_section_nr(nid, usage); in sparse_init_nid()
572 int nid = sparse_early_nid(__nr_to_section(pnum_end)); in sparse_init() local
574 if (nid == nid_begin) { in sparse_init()
580 nid_begin = nid; in sparse_init()
632 unsigned long nr_pages, int nid, struct vmem_altmap *altmap) in populate_section_memmap() argument
634 return __populate_section_memmap(pfn, nr_pages, nid, altmap); in populate_section_memmap()
703 unsigned long nr_pages, int nid, struct vmem_altmap *altmap) in populate_section_memmap() argument
706 PAGES_PER_SECTION), GFP_KERNEL, nid); in populate_section_memmap()
825 static struct page * __meminit section_activate(int nid, unsigned long pfn, in section_activate() argument
858 memmap = populate_section_memmap(pfn, nr_pages, nid, altmap); in section_activate()
885 int __meminit sparse_add_section(int nid, unsigned long start_pfn, in sparse_add_section() argument
893 ret = sparse_index_init(section_nr, nid); in sparse_add_section()
897 memmap = section_activate(nid, start_pfn, nr_pages, altmap); in sparse_add_section()
908 set_section_nid(section_nr, nid); in sparse_add_section()