Lines Matching defs:nid

52 static void set_section_nid(unsigned long section_nr, int nid)
54 section_to_node_table[section_nr] = nid;
57 static inline void set_section_nid(unsigned long section_nr, int nid)
63 static noinline struct mem_section __ref *sparse_index_alloc(int nid)
70 section = kzalloc_node(array_size, GFP_KERNEL, nid);
73 nid);
75 panic("%s: Failed to allocate %lu bytes nid=%d\n",
76 __func__, array_size, nid);
82 static int __meminit sparse_index_init(unsigned long section_nr, int nid)
97 section = sparse_index_alloc(nid);
106 static inline int sparse_index_init(unsigned long section_nr, int nid)
118 static inline unsigned long sparse_encode_early_nid(int nid)
120 return ((unsigned long)nid << SECTION_NID_SHIFT);
225 static void __init memory_present(int nid, unsigned long start, unsigned long end)
248 sparse_index_init(section, nid);
249 set_section_nid(section, nid);
253 ms->section_mem_map = sparse_encode_early_nid(nid) |
268 int i, nid;
270 for_each_mem_pfn_range(i, MAX_NUMNODES, &start, &end, &nid)
271 memory_present(nid, start, end);
337 int nid;
350 nid = early_pfn_to_nid(goal >> PAGE_SHIFT);
352 usage = memblock_alloc_try_nid(size, SMP_CACHE_BYTES, goal, limit, nid);
360 static void __init check_usemap_section_nr(int nid,
366 struct pglist_data *pgdat = NODE_DATA(nid);
388 if (usemap_nid != nid) {
390 nid, usemap_snr);
400 usemap_snr, pgdat_snr, nid);
410 static void __init check_usemap_section_nr(int nid,
429 unsigned long nr_pages, int nid, struct vmem_altmap *altmap,
439 map = memmap_alloc(size, size, addr, nid, false);
441 panic("%s: Failed to allocate %lu bytes align=0x%lx nid=%d from=%pa\n",
442 __func__, size, PAGE_SIZE, nid, &addr);
457 static void __init sparse_buffer_init(unsigned long size, int nid)
466 sparsemap_buf = memmap_alloc(size, section_map_size(), addr, nid, true);
505 static void __init sparse_init_nid(int nid, unsigned long pnum_begin,
513 usage = sparse_early_usemaps_alloc_pgdat_section(NODE_DATA(nid),
516 pr_err("%s: node[%d] usemap allocation failed", __func__, nid);
519 sparse_buffer_init(map_count * section_map_size(), nid);
527 nid, NULL, NULL);
530 __func__, nid);
535 check_usemap_section_nr(nid, usage);
572 int nid = sparse_early_nid(__nr_to_section(pnum_end));
574 if (nid == nid_begin) {
580 nid_begin = nid;
632 unsigned long nr_pages, int nid, struct vmem_altmap *altmap,
635 return __populate_section_memmap(pfn, nr_pages, nid, altmap, pgmap);
704 unsigned long nr_pages, int nid, struct vmem_altmap *altmap,
708 PAGES_PER_SECTION), GFP_KERNEL, nid);
828 static struct page * __meminit section_activate(int nid, unsigned long pfn,
862 memmap = populate_section_memmap(pfn, nr_pages, nid, altmap, pgmap);
873 * @nid: The node to add section on
890 int __meminit sparse_add_section(int nid, unsigned long start_pfn,
899 ret = sparse_index_init(section_nr, nid);
903 memmap = section_activate(nid, start_pfn, nr_pages, altmap, pgmap);
914 set_section_nid(section_nr, nid);