Lines Matching refs:nid

304 int __ref __add_pages(int nid, unsigned long pfn, unsigned long nr_pages,  in __add_pages()  argument
337 err = sparse_add_section(nid, pfn, cur_nr_pages, altmap); in __add_pages()
347 static unsigned long find_smallest_section_pfn(int nid, struct zone *zone, in find_smallest_section_pfn() argument
355 if (unlikely(pfn_to_nid(start_pfn) != nid)) in find_smallest_section_pfn()
368 static unsigned long find_biggest_section_pfn(int nid, struct zone *zone, in find_biggest_section_pfn() argument
380 if (unlikely(pfn_to_nid(pfn) != nid)) in find_biggest_section_pfn()
396 int nid = zone_to_nid(zone); in shrink_zone_span() local
405 pfn = find_smallest_section_pfn(nid, zone, end_pfn, in shrink_zone_span()
421 pfn = find_biggest_section_pfn(nid, zone, zone->zone_start_pfn, in shrink_zone_span()
620 int nid = zone_to_nid(zone); in node_states_check_changes_online() local
625 if (!node_state(nid, N_MEMORY)) in node_states_check_changes_online()
626 arg->status_change_nid = nid; in node_states_check_changes_online()
627 if (zone_idx(zone) <= ZONE_NORMAL && !node_state(nid, N_NORMAL_MEMORY)) in node_states_check_changes_online()
628 arg->status_change_nid_normal = nid; in node_states_check_changes_online()
684 int nid = pgdat->node_id; in move_pfn_range_to_zone() local
712 memmap_init_range(nr_pages, nid, zone_idx(zone), start_pfn, 0, in move_pfn_range_to_zone()
772 static bool auto_movable_can_online_movable(int nid, struct memory_group *group, in auto_movable_can_online_movable() argument
778 pg_data_t *pgdat = NODE_DATA(nid); in auto_movable_can_online_movable()
783 if (nid == NUMA_NO_NODE) { in auto_movable_can_online_movable()
803 walk_dynamic_memory_groups(nid, auto_movable_stats_account_group, in auto_movable_can_online_movable()
826 static struct zone *default_kernel_zone_for_pfn(int nid, unsigned long start_pfn, in default_kernel_zone_for_pfn() argument
829 struct pglist_data *pgdat = NODE_DATA(nid); in default_kernel_zone_for_pfn()
892 static struct zone *auto_movable_zone_for_pfn(int nid, in auto_movable_zone_for_pfn() argument
944 !auto_movable_can_online_movable(nid, group, nr_pages)) in auto_movable_zone_for_pfn()
948 return &NODE_DATA(nid)->node_zones[ZONE_MOVABLE]; in auto_movable_zone_for_pfn()
950 return default_kernel_zone_for_pfn(nid, pfn, nr_pages); in auto_movable_zone_for_pfn()
953 static inline struct zone *default_zone_for_pfn(int nid, unsigned long start_pfn, in default_zone_for_pfn() argument
956 struct zone *kernel_zone = default_kernel_zone_for_pfn(nid, start_pfn, in default_zone_for_pfn()
958 struct zone *movable_zone = &NODE_DATA(nid)->node_zones[ZONE_MOVABLE]; in default_zone_for_pfn()
977 struct zone *zone_for_pfn_range(int online_type, int nid, in zone_for_pfn_range() argument
982 return default_kernel_zone_for_pfn(nid, start_pfn, nr_pages); in zone_for_pfn_range()
985 return &NODE_DATA(nid)->node_zones[ZONE_MOVABLE]; in zone_for_pfn_range()
988 return auto_movable_zone_for_pfn(nid, group, start_pfn, nr_pages); in zone_for_pfn_range()
990 return default_zone_for_pfn(nid, start_pfn, nr_pages); in zone_for_pfn_range()
1066 const int nid = zone_to_nid(zone); in online_pages() local
1117 node_states_set_node(nid, &arg); in online_pages()
1135 kswapd_run(nid); in online_pages()
1136 kcompactd_run(nid); in online_pages()
1165 static pg_data_t __ref *hotadd_new_pgdat(int nid) in hotadd_new_pgdat() argument
1169 pgdat = NODE_DATA(nid); in hotadd_new_pgdat()
1171 pgdat = arch_alloc_nodedata(nid); in hotadd_new_pgdat()
1177 arch_refresh_nodedata(nid, pgdat); in hotadd_new_pgdat()
1197 pgdat->node_id = nid; in hotadd_new_pgdat()
1201 free_area_init_core_hotplug(nid); in hotadd_new_pgdat()
1220 static void rollback_node_hotadd(int nid) in rollback_node_hotadd() argument
1222 pg_data_t *pgdat = NODE_DATA(nid); in rollback_node_hotadd()
1224 arch_refresh_nodedata(nid, NULL); in rollback_node_hotadd()
1241 static int __try_online_node(int nid, bool set_node_online) in __try_online_node() argument
1246 if (node_online(nid)) in __try_online_node()
1249 pgdat = hotadd_new_pgdat(nid); in __try_online_node()
1251 pr_err("Cannot online node %d due to NULL pgdat\n", nid); in __try_online_node()
1257 node_set_online(nid); in __try_online_node()
1258 ret = register_one_node(nid); in __try_online_node()
1268 int try_online_node(int nid) in try_online_node() argument
1273 ret = __try_online_node(nid, true); in try_online_node()
1343 int __ref add_memory_resource(int nid, struct resource *res, mhp_t mhp_flags) in add_memory_resource() argument
1361 group = memory_group_find_by_id(nid); in add_memory_resource()
1364 nid = group->nid; in add_memory_resource()
1367 if (!node_possible(nid)) { in add_memory_resource()
1368 WARN(1, "node %d was absent from the node_possible_map\n", nid); in add_memory_resource()
1377 ret = memblock_add_node(start, size, nid, memblock_flags); in add_memory_resource()
1382 ret = __try_online_node(nid, false); in add_memory_resource()
1401 ret = arch_add_memory(nid, start, size, &params); in add_memory_resource()
1419 node_set_online(nid); in add_memory_resource()
1420 ret = __register_one_node(nid); in add_memory_resource()
1425 link_mem_sections(nid, PFN_DOWN(start), PFN_UP(start + size - 1), in add_memory_resource()
1450 rollback_node_hotadd(nid); in add_memory_resource()
1459 int __ref __add_memory(int nid, u64 start, u64 size, mhp_t mhp_flags) in __add_memory() argument
1468 ret = add_memory_resource(nid, res, mhp_flags); in __add_memory()
1474 int add_memory(int nid, u64 start, u64 size, mhp_t mhp_flags) in add_memory() argument
1479 rc = __add_memory(nid, start, size, mhp_flags); in add_memory()
1507 int add_memory_driver_managed(int nid, u64 start, u64 size, in add_memory_driver_managed() argument
1526 rc = add_memory_resource(nid, res, mhp_flags); in add_memory_driver_managed()
1755 mtc.nid = page_to_nid(list_first_entry(&source, struct page, lru)); in do_migrate_range()
1762 node_clear(mtc.nid, nmask); in do_migrate_range()
1764 node_set(mtc.nid, nmask); in do_migrate_range()
2025 int *nid = arg; in check_memblock_offlined_cb() local
2027 *nid = mem->nid; in check_memblock_offlined_cb()
2067 int nid = *(int *)arg; in check_no_memblock_for_node_cb() local
2074 return mem->nid == nid ? -EEXIST : 0; in check_no_memblock_for_node_cb()
2086 void try_offline_node(int nid) in try_offline_node() argument
2088 pg_data_t *pgdat = NODE_DATA(nid); in try_offline_node()
2104 rc = for_each_memory_block(&nid, check_no_memblock_for_node_cb); in try_offline_node()
2115 node_set_offline(nid); in try_offline_node()
2116 unregister_one_node(nid); in try_offline_node()
2125 int rc = 0, nid = NUMA_NO_NODE; in try_remove_memory() local
2138 rc = walk_memory_blocks(start, size, &nid, check_memblock_offlined_cb); in try_remove_memory()
2187 if (nid != NUMA_NO_NODE) in try_remove_memory()
2188 try_offline_node(nid); in try_remove_memory()