Lines Matching refs:nid
42 int nid; in mminit_verify_zonelist() local
47 for_each_online_node(nid) { in mminit_verify_zonelist()
48 pg_data_t *pgdat = NODE_DATA(nid); in mminit_verify_zonelist()
67 listid > 0 ? "thisnode" : "general", nid, in mminit_verify_zonelist()
301 int i, nid; in early_calculate_totalpages() local
303 for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, &nid) { in early_calculate_totalpages()
308 node_set_state(nid, N_MEMORY); in early_calculate_totalpages()
342 int i, nid; in find_zone_movable_pfns_for_nodes() local
363 nid = memblock_get_region_node(r); in find_zone_movable_pfns_for_nodes()
366 zone_movable_pfn[nid] = zone_movable_pfn[nid] ? in find_zone_movable_pfns_for_nodes()
367 min(usable_startpfn, zone_movable_pfn[nid]) : in find_zone_movable_pfns_for_nodes()
394 nid = memblock_get_region_node(r); in find_zone_movable_pfns_for_nodes()
403 zone_movable_pfn[nid] = zone_movable_pfn[nid] ? in find_zone_movable_pfns_for_nodes()
404 min(usable_startpfn, zone_movable_pfn[nid]) : in find_zone_movable_pfns_for_nodes()
461 for_each_node_state(nid, N_MEMORY) { in find_zone_movable_pfns_for_nodes()
480 for_each_mem_pfn_range(i, nid, &start_pfn, &end_pfn, NULL) { in find_zone_movable_pfns_for_nodes()
483 start_pfn = max(start_pfn, zone_movable_pfn[nid]); in find_zone_movable_pfns_for_nodes()
507 zone_movable_pfn[nid] = end_pfn; in find_zone_movable_pfns_for_nodes()
521 zone_movable_pfn[nid] = start_pfn + size_pages; in find_zone_movable_pfns_for_nodes()
548 for (nid = 0; nid < MAX_NUMNODES; nid++) { in find_zone_movable_pfns_for_nodes()
551 zone_movable_pfn[nid] = in find_zone_movable_pfns_for_nodes()
552 roundup(zone_movable_pfn[nid], MAX_ORDER_NR_PAGES); in find_zone_movable_pfns_for_nodes()
554 get_pfn_range_for_nid(nid, &start_pfn, &end_pfn); in find_zone_movable_pfns_for_nodes()
555 if (zone_movable_pfn[nid] >= end_pfn) in find_zone_movable_pfns_for_nodes()
556 zone_movable_pfn[nid] = 0; in find_zone_movable_pfns_for_nodes()
565 unsigned long zone, int nid) in __init_single_page() argument
568 set_page_links(page, zone, nid, pfn); in __init_single_page()
603 int nid; in __early_pfn_to_nid() local
608 nid = memblock_search_pfn_nid(pfn, &start_pfn, &end_pfn); in __early_pfn_to_nid()
609 if (nid != NUMA_NO_NODE) { in __early_pfn_to_nid()
612 state->last_nid = nid; in __early_pfn_to_nid()
615 return nid; in __early_pfn_to_nid()
621 int nid; in early_pfn_to_nid() local
624 nid = __early_pfn_to_nid(pfn, &early_pfnnid_cache); in early_pfn_to_nid()
625 if (nid < 0) in early_pfn_to_nid()
626 nid = first_online_node; in early_pfn_to_nid()
629 return nid; in early_pfn_to_nid()
659 static inline bool __meminit early_page_initialised(unsigned long pfn, int nid) in early_page_initialised() argument
661 if (node_online(nid) && pfn >= NODE_DATA(nid)->first_deferred_pfn) in early_page_initialised()
672 defer_init(int nid, unsigned long pfn, unsigned long end_pfn) in defer_init() argument
688 if (end_pfn < pgdat_end_pfn(NODE_DATA(nid))) in defer_init()
691 if (NODE_DATA(nid)->first_deferred_pfn != ULONG_MAX) in defer_init()
700 NODE_DATA(nid)->first_deferred_pfn = pfn; in defer_init()
706 static void __meminit init_reserved_page(unsigned long pfn, int nid) in init_reserved_page() argument
711 if (early_page_initialised(pfn, nid)) in init_reserved_page()
714 pgdat = NODE_DATA(nid); in init_reserved_page()
722 __init_single_page(pfn_to_page(pfn), pfn, zid, nid); in init_reserved_page()
727 static inline bool early_page_initialised(unsigned long pfn, int nid) in early_page_initialised() argument
732 static inline bool defer_init(int nid, unsigned long pfn, unsigned long end_pfn) in defer_init() argument
737 static inline void init_reserved_page(unsigned long pfn, int nid) in init_reserved_page() argument
749 phys_addr_t end, int nid) in reserve_bootmem_region() argument
758 init_reserved_page(start_pfn, nid); in reserve_bootmem_region()
848 void __meminit memmap_init_range(unsigned long size, int nid, unsigned long zone, in memmap_init_range() argument
885 if (defer_init(nid, pfn, zone_end_pfn)) { in memmap_init_range()
892 __init_single_page(page, pfn, zone, nid); in memmap_init_range()
916 int nid = zone_to_nid(zone), zone_id = zone_idx(zone); in memmap_init_zone_range() local
924 memmap_init_range(end_pfn - start_pfn, nid, zone_id, start_pfn, in memmap_init_zone_range()
928 init_unavailable_range(*hole_pfn, start_pfn, zone_id, nid); in memmap_init_zone_range()
937 int i, j, zone_id = 0, nid; in memmap_init() local
939 for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, &nid) { in memmap_init()
940 struct pglist_data *node = NODE_DATA(nid); in memmap_init()
967 init_unavailable_range(hole_pfn, end_pfn, zone_id, nid); in memmap_init()
972 unsigned long zone_idx, int nid, in __init_zone_device_page() argument
976 __init_single_page(page, pfn, zone_idx, nid); in __init_zone_device_page()
1038 unsigned long zone_idx, int nid, in memmap_init_compound() argument
1049 __init_zone_device_page(page, pfn, zone_idx, nid, pgmap); in memmap_init_compound()
1074 int nid = pgdat->node_id; in memmap_init_zone_device() local
1092 __init_zone_device_page(page, pfn, zone_idx, nid, pgmap); in memmap_init_zone_device()
1097 memmap_init_compound(page, pfn, zone_idx, nid, pgmap, in memmap_init_zone_device()
1116 static void __init adjust_zone_range_for_zone_movable(int nid, in adjust_zone_range_for_zone_movable() argument
1123 if (zone_movable_pfn[nid]) { in adjust_zone_range_for_zone_movable()
1126 *zone_start_pfn = zone_movable_pfn[nid]; in adjust_zone_range_for_zone_movable()
1132 *zone_start_pfn < zone_movable_pfn[nid] && in adjust_zone_range_for_zone_movable()
1133 *zone_end_pfn > zone_movable_pfn[nid]) { in adjust_zone_range_for_zone_movable()
1134 *zone_end_pfn = zone_movable_pfn[nid]; in adjust_zone_range_for_zone_movable()
1137 } else if (*zone_start_pfn >= zone_movable_pfn[nid]) in adjust_zone_range_for_zone_movable()
1146 unsigned long __init __absent_pages_in_range(int nid, in __absent_pages_in_range() argument
1154 for_each_mem_pfn_range(i, nid, &start_pfn, &end_pfn, NULL) { in __absent_pages_in_range()
1176 static unsigned long __init zone_absent_pages_in_node(int nid, in zone_absent_pages_in_node() argument
1187 nr_absent = __absent_pages_in_range(nid, zone_start_pfn, zone_end_pfn); in zone_absent_pages_in_node()
1194 if (mirrored_kernelcore && zone_movable_pfn[nid]) { in zone_absent_pages_in_node()
1221 static unsigned long __init zone_spanned_pages_in_node(int nid, in zone_spanned_pages_in_node() argument
1234 adjust_zone_range_for_zone_movable(nid, zone_type, node_end_pfn, in zone_spanned_pages_in_node()
1372 static void __meminit zone_init_internals(struct zone *zone, enum zone_type idx, int nid, in zone_init_internals() argument
1376 zone_set_nid(zone, nid); in zone_init_internals()
1378 zone->zone_pgdat = NODE_DATA(nid); in zone_init_internals()
1504 int nid = pgdat->node_id; in free_area_init_core_hotplug() local
1540 zone_init_internals(zone, z, nid, 0); in free_area_init_core_hotplug()
1557 int nid = pgdat->node_id; in free_area_init_core() local
1604 zone_init_internals(zone, j, nid, freesize); in free_area_init_core()
1615 phys_addr_t min_addr, int nid, bool exact_nid) in memmap_alloc() argument
1622 nid); in memmap_alloc()
1626 nid); in memmap_alloc()
1694 void __init get_pfn_range_for_nid(unsigned int nid, in get_pfn_range_for_nid() argument
1703 for_each_mem_pfn_range(i, nid, &this_start_pfn, &this_end_pfn, NULL) { in get_pfn_range_for_nid()
1712 static void __init free_area_init_node(int nid) in free_area_init_node() argument
1714 pg_data_t *pgdat = NODE_DATA(nid); in free_area_init_node()
1721 get_pfn_range_for_nid(nid, &start_pfn, &end_pfn); in free_area_init_node()
1723 pgdat->node_id = nid; in free_area_init_node()
1728 pr_info("Initmem setup node %d [mem %#018Lx-%#018Lx]\n", nid, in free_area_init_node()
1734 pr_info("Initmem setup node %d as memoryless\n", nid); in free_area_init_node()
1801 int i, nid, zone; in free_area_init() local
1864 for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, &nid) { in free_area_init()
1865 pr_info(" node %3d: [mem %#018Lx-%#018Lx]\n", nid, in free_area_init()
1876 for_each_node(nid) { in free_area_init()
1879 if (!node_online(nid)) { in free_area_init()
1880 pr_info("Initializing node %d as memoryless\n", nid); in free_area_init()
1883 pgdat = arch_alloc_nodedata(nid); in free_area_init()
1886 sizeof(*pgdat), nid); in free_area_init()
1887 arch_refresh_nodedata(nid, pgdat); in free_area_init()
1888 free_area_init_node(nid); in free_area_init()
1903 pgdat = NODE_DATA(nid); in free_area_init()
1904 free_area_init_node(nid); in free_area_init()
1908 node_set_state(nid, N_MEMORY); in free_area_init()
1942 int i, nid; in node_map_pfn_alignment() local
1944 for_each_mem_pfn_range(i, MAX_NUMNODES, &start, &end, &nid) { in node_map_pfn_alignment()
1945 if (!start || last_nid < 0 || last_nid == nid) { in node_map_pfn_alignment()
1946 last_nid = nid; in node_map_pfn_alignment()
2054 int nid = zone_to_nid(zone); in deferred_init_pages() local
2068 __init_single_page(page, pfn, zid, nid); in deferred_init_pages()
2384 int nid; in page_alloc_init_late() local
2390 for_each_node_state(nid, N_MEMORY) { in page_alloc_init_late()
2391 kthread_run(deferred_init_memmap, NODE_DATA(nid), "pgdatinit%d", nid); in page_alloc_init_late()
2412 for_each_node_state(nid, N_MEMORY) in page_alloc_init_late()
2413 shuffle_free_memory(NODE_DATA(nid)); in page_alloc_init_late()
2581 int nid = early_pfn_to_nid(pfn); in memblock_free_pages() local
2583 if (!early_page_initialised(pfn, nid)) in memblock_free_pages()