Lines Matching refs:pfn
185 static void subsection_mask_set(unsigned long *map, unsigned long pfn, in subsection_mask_set() argument
188 int idx = subsection_map_index(pfn); in subsection_mask_set()
189 int end = subsection_map_index(pfn + nr_pages - 1); in subsection_mask_set()
194 void __init subsection_map_init(unsigned long pfn, unsigned long nr_pages) in subsection_map_init() argument
196 int end_sec = pfn_to_section_nr(pfn + nr_pages - 1); in subsection_map_init()
197 unsigned long nr, start_sec = pfn_to_section_nr(pfn); in subsection_map_init()
207 - (pfn & ~PAGE_SECTION_MASK)); in subsection_map_init()
209 subsection_mask_set(ms->usage->subsection_map, pfn, pfns); in subsection_map_init()
212 pfns, subsection_map_index(pfn), in subsection_map_init()
213 subsection_map_index(pfn + pfns - 1)); in subsection_map_init()
215 pfn += pfns; in subsection_map_init()
220 void __init subsection_map_init(unsigned long pfn, unsigned long nr_pages) in subsection_map_init() argument
228 unsigned long pfn; in memory_present() local
245 for (pfn = start; pfn < end; pfn += PAGES_PER_SECTION) { in memory_present()
246 unsigned long section = pfn_to_section_nr(pfn); in memory_present()
429 struct page __init *__populate_section_memmap(unsigned long pfn, in __populate_section_memmap() argument
522 unsigned long pfn = section_nr_to_pfn(pnum); in sparse_init_nid() local
527 map = __populate_section_memmap(pfn, PAGES_PER_SECTION, in sparse_init_nid()
595 unsigned long pfn; in online_mem_sections() local
597 for (pfn = start_pfn; pfn < end_pfn; pfn += PAGES_PER_SECTION) { in online_mem_sections()
598 unsigned long section_nr = pfn_to_section_nr(pfn); in online_mem_sections()
613 unsigned long pfn; in offline_mem_sections() local
615 for (pfn = start_pfn; pfn < end_pfn; pfn += PAGES_PER_SECTION) { in offline_mem_sections()
616 unsigned long section_nr = pfn_to_section_nr(pfn); in offline_mem_sections()
632 static struct page * __meminit populate_section_memmap(unsigned long pfn, in populate_section_memmap() argument
636 return __populate_section_memmap(pfn, nr_pages, nid, altmap, pgmap); in populate_section_memmap()
639 static void depopulate_section_memmap(unsigned long pfn, unsigned long nr_pages, in depopulate_section_memmap() argument
642 unsigned long start = (unsigned long) pfn_to_page(pfn); in depopulate_section_memmap()
655 static int clear_subsection_map(unsigned long pfn, unsigned long nr_pages) in clear_subsection_map() argument
659 struct mem_section *ms = __pfn_to_section(pfn); in clear_subsection_map()
663 subsection_mask_set(map, pfn, nr_pages); in clear_subsection_map()
669 pfn, nr_pages)) in clear_subsection_map()
682 static int fill_subsection_map(unsigned long pfn, unsigned long nr_pages) in fill_subsection_map() argument
684 struct mem_section *ms = __pfn_to_section(pfn); in fill_subsection_map()
689 subsection_mask_set(map, pfn, nr_pages); in fill_subsection_map()
704 struct page * __meminit populate_section_memmap(unsigned long pfn, in populate_section_memmap() argument
712 static void depopulate_section_memmap(unsigned long pfn, unsigned long nr_pages, in depopulate_section_memmap() argument
715 kvfree(pfn_to_page(pfn)); in depopulate_section_memmap()
748 static int clear_subsection_map(unsigned long pfn, unsigned long nr_pages) in clear_subsection_map() argument
758 static int fill_subsection_map(unsigned long pfn, unsigned long nr_pages) in fill_subsection_map() argument
780 static void section_deactivate(unsigned long pfn, unsigned long nr_pages, in section_deactivate() argument
783 struct mem_section *ms = __pfn_to_section(pfn); in section_deactivate()
788 if (clear_subsection_map(pfn, nr_pages)) in section_deactivate()
793 unsigned long section_nr = pfn_to_section_nr(pfn); in section_deactivate()
820 depopulate_section_memmap(pfn, nr_pages, altmap); in section_deactivate()
828 static struct page * __meminit section_activate(int nid, unsigned long pfn, in section_activate() argument
832 struct mem_section *ms = __pfn_to_section(pfn); in section_activate()
844 rc = fill_subsection_map(pfn, nr_pages); in section_activate()
860 return pfn_to_page(pfn); in section_activate()
862 memmap = populate_section_memmap(pfn, nr_pages, nid, altmap, pgmap); in section_activate()
864 section_deactivate(pfn, nr_pages, altmap); in section_activate()
925 void sparse_remove_section(struct mem_section *ms, unsigned long pfn, in sparse_remove_section() argument
929 clear_hwpoisoned_pages(pfn_to_page(pfn) + map_offset, in sparse_remove_section()
931 section_deactivate(pfn, nr_pages, altmap); in sparse_remove_section()