Lines Matching refs:nr_pages
222 unsigned long i, pfn, end_pfn, nr_pages; in register_page_bootmem_info_node() local
226 nr_pages = PAGE_ALIGN(sizeof(struct pglist_data)) >> PAGE_SHIFT; in register_page_bootmem_info_node()
229 for (i = 0; i < nr_pages; i++, page++) in register_page_bootmem_info_node()
274 unsigned long nr_pages, struct vmem_altmap *altmap, in __add_pages() argument
283 end_sec = pfn_to_section_nr(phys_start_pfn + nr_pages - 1); in __add_pages()
290 || vmem_altmap_offset(altmap) > nr_pages) { in __add_pages()
508 int nr_pages = PAGES_PER_SECTION; in __remove_zone() local
512 shrink_zone_span(zone, start_pfn, start_pfn + nr_pages); in __remove_zone()
513 shrink_pgdat_span(pgdat, start_pfn, start_pfn + nr_pages); in __remove_zone()
552 unsigned long nr_pages, struct vmem_altmap *altmap) in __remove_pages() argument
566 size = nr_pages * PAGE_SIZE; in __remove_pages()
584 BUG_ON(nr_pages % PAGES_PER_SECTION); in __remove_pages()
586 sections_to_remove = nr_pages / PAGES_PER_SECTION; in __remove_pages()
665 static int online_pages_range(unsigned long start_pfn, unsigned long nr_pages, in online_pages_range() argument
673 for (i = 0; i < nr_pages; i++) { in online_pages_range()
679 online_mem_sections(start_pfn, start_pfn + nr_pages); in online_pages_range()
686 static void node_states_check_changes_online(unsigned long nr_pages, in node_states_check_changes_online() argument
760 unsigned long nr_pages) in resize_zone_range() argument
767 zone->spanned_pages = max(start_pfn + nr_pages, old_end_pfn) - zone->zone_start_pfn; in resize_zone_range()
771 unsigned long nr_pages) in resize_pgdat_range() argument
778 pgdat->node_spanned_pages = max(start_pfn + nr_pages, old_end_pfn) - pgdat->node_start_pfn; in resize_pgdat_range()
782 unsigned long nr_pages, struct vmem_altmap *altmap) in move_pfn_range_to_zone() argument
789 init_currently_empty_zone(zone, start_pfn, nr_pages); in move_pfn_range_to_zone()
796 resize_zone_range(zone, start_pfn, nr_pages); in move_pfn_range_to_zone()
798 resize_pgdat_range(pgdat, start_pfn, nr_pages); in move_pfn_range_to_zone()
807 memmap_init_zone(nr_pages, nid, zone_idx(zone), start_pfn, in move_pfn_range_to_zone()
819 unsigned long nr_pages) in default_kernel_zone_for_pfn() argument
827 if (zone_intersects(zone, start_pfn, nr_pages)) in default_kernel_zone_for_pfn()
835 unsigned long nr_pages) in default_zone_for_pfn() argument
838 nr_pages); in default_zone_for_pfn()
840 bool in_kernel = zone_intersects(kernel_zone, start_pfn, nr_pages); in default_zone_for_pfn()
841 bool in_movable = zone_intersects(movable_zone, start_pfn, nr_pages); in default_zone_for_pfn()
859 unsigned long nr_pages) in zone_for_pfn_range() argument
862 return default_kernel_zone_for_pfn(nid, start_pfn, nr_pages); in zone_for_pfn_range()
867 return default_zone_for_pfn(nid, start_pfn, nr_pages); in zone_for_pfn_range()
875 unsigned long start_pfn, unsigned long nr_pages) in move_pfn_range() argument
879 zone = zone_for_pfn_range(online_type, nid, start_pfn, nr_pages); in move_pfn_range()
880 move_pfn_range_to_zone(zone, start_pfn, nr_pages, NULL); in move_pfn_range()
885 int __ref online_pages(unsigned long pfn, unsigned long nr_pages, int online_type) in online_pages() argument
904 zone = move_pfn_range(online_type, nid, pfn, nr_pages); in online_pages()
907 arg.nr_pages = nr_pages; in online_pages()
908 node_states_check_changes_online(nr_pages, zone, &arg); in online_pages()
925 ret = walk_system_ram_range(pfn, nr_pages, &onlined_pages, in online_pages()
965 (((unsigned long long) pfn + nr_pages) << PAGE_SHIFT) - 1); in online_pages()
1095 u64 nr_pages = size >> PAGE_SHIFT; in check_hotplug_memory_range() local
1099 if (!nr_pages || !IS_ALIGNED(start_pfn, block_nr_pages) || in check_hotplug_memory_range()
1100 !IS_ALIGNED(nr_pages, block_nr_pages)) { in check_hotplug_memory_range()
1256 bool is_mem_section_removable(unsigned long start_pfn, unsigned long nr_pages) in is_mem_section_removable() argument
1259 struct page *end_page = page + nr_pages; in is_mem_section_removable()
1448 offline_isolated_pages_cb(unsigned long start, unsigned long nr_pages, in offline_isolated_pages_cb() argument
1451 __offline_isolated_pages(start, start + nr_pages); in offline_isolated_pages_cb()
1466 check_pages_isolated_cb(unsigned long start_pfn, unsigned long nr_pages, in check_pages_isolated_cb() argument
1471 ret = test_pages_isolated(start_pfn, start_pfn + nr_pages, true); in check_pages_isolated_cb()
1472 offlined = nr_pages; in check_pages_isolated_cb()
1503 static void node_states_check_changes_offline(unsigned long nr_pages, in node_states_check_changes_offline() argument
1531 if (zone_idx(zone) <= zone_last && nr_pages >= present_pages) in node_states_check_changes_offline()
1552 if (zone_idx(zone) <= zone_last && nr_pages >= present_pages) in node_states_check_changes_offline()
1573 if (nr_pages >= present_pages) in node_states_check_changes_offline()
1596 unsigned long pfn, nr_pages; in __offline_pages() local
1616 nr_pages = end_pfn - start_pfn; in __offline_pages()
1625 arg.nr_pages = nr_pages; in __offline_pages()
1626 node_states_check_changes_offline(nr_pages, zone, &arg); in __offline_pages()
1706 int offline_pages(unsigned long start_pfn, unsigned long nr_pages) in offline_pages() argument
1708 return __offline_pages(start_pfn, start_pfn + nr_pages); in offline_pages()