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()
225 static void __init memory_present(int nid, unsigned long start, unsigned long end) in memory_present() argument
248 sparse_index_init(section, nid); in memory_present()
249 set_section_nid(section, nid); in memory_present()
253 ms->section_mem_map = sparse_encode_early_nid(nid) | in memory_present()
268 int i, nid; in memblocks_present() local
270 for_each_mem_pfn_range(i, MAX_NUMNODES, &start, &end, &nid) in memblocks_present()
271 memory_present(nid, start, end); in memblocks_present()
337 int nid; in sparse_early_usemaps_alloc_pgdat_section() local
350 nid = early_pfn_to_nid(goal >> PAGE_SHIFT); in sparse_early_usemaps_alloc_pgdat_section()
352 usage = memblock_alloc_try_nid(size, SMP_CACHE_BYTES, goal, limit, nid); in sparse_early_usemaps_alloc_pgdat_section()
360 static void __init check_usemap_section_nr(int nid, in check_usemap_section_nr() argument
366 struct pglist_data *pgdat = NODE_DATA(nid); in check_usemap_section_nr()
388 if (usemap_nid != nid) { in check_usemap_section_nr()
390 nid, usemap_snr); in check_usemap_section_nr()
400 usemap_snr, pgdat_snr, nid); in check_usemap_section_nr()
410 static void __init check_usemap_section_nr(int nid, in check_usemap_section_nr() argument
429 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, 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
635 return __populate_section_memmap(pfn, nr_pages, nid, altmap, pgmap); in populate_section_memmap()
704 unsigned long nr_pages, int nid, struct vmem_altmap *altmap, in populate_section_memmap() argument
708 PAGES_PER_SECTION), GFP_KERNEL, nid); in populate_section_memmap()
828 static struct page * __meminit section_activate(int nid, unsigned long pfn, in section_activate() argument
862 memmap = populate_section_memmap(pfn, nr_pages, nid, altmap, pgmap); in section_activate()
890 int __meminit sparse_add_section(int nid, unsigned long start_pfn, in sparse_add_section() argument
899 ret = sparse_index_init(section_nr, nid); in sparse_add_section()
903 memmap = section_activate(nid, start_pfn, nr_pages, altmap, pgmap); in sparse_add_section()
914 set_section_nid(section_nr, nid); in sparse_add_section()