Lines Matching refs:ms

164 static void __section_mark_present(struct mem_section *ms,  in __section_mark_present()  argument
170 ms->section_mem_map |= SECTION_MARKED_PRESENT; in __section_mark_present()
202 struct mem_section *ms; in subsection_map_init() local
207 ms = __nr_to_section(nr); in subsection_map_init()
208 subsection_mask_set(ms->usage->subsection_map, pfn, pfns); in subsection_map_init()
246 struct mem_section *ms; in memory_present() local
251 ms = __nr_to_section(section); in memory_present()
252 if (!ms->section_mem_map) { in memory_present()
253 ms->section_mem_map = sparse_encode_early_nid(nid) | in memory_present()
255 __section_mark_present(ms, section); in memory_present()
300 static void __meminit sparse_init_one_section(struct mem_section *ms, in sparse_init_one_section() argument
304 ms->section_mem_map &= ~SECTION_MAP_MASK; in sparse_init_one_section()
305 ms->section_mem_map |= sparse_encode_mem_map(mem_map, pnum) in sparse_init_one_section()
307 ms->usage = usage; in sparse_init_one_section()
545 struct mem_section *ms; in sparse_init_nid() local
549 ms = __nr_to_section(pnum); in sparse_init_nid()
550 ms->section_mem_map = 0; in sparse_init_nid()
598 struct mem_section *ms; in online_mem_sections() local
604 ms = __nr_to_section(section_nr); in online_mem_sections()
605 ms->section_mem_map |= SECTION_IS_ONLINE; in online_mem_sections()
616 struct mem_section *ms; in offline_mem_sections() local
625 ms = __nr_to_section(section_nr); in offline_mem_sections()
626 ms->section_mem_map &= ~SECTION_IS_ONLINE; in offline_mem_sections()
658 struct mem_section *ms = __pfn_to_section(pfn); in clear_subsection_map() local
659 unsigned long *subsection_map = ms->usage in clear_subsection_map()
660 ? &ms->usage->subsection_map[0] : NULL; in clear_subsection_map()
675 static bool is_subsection_map_empty(struct mem_section *ms) in is_subsection_map_empty() argument
677 return bitmap_empty(&ms->usage->subsection_map[0], in is_subsection_map_empty()
683 struct mem_section *ms = __pfn_to_section(pfn); in fill_subsection_map() local
690 subsection_map = &ms->usage->subsection_map[0]; in fill_subsection_map()
752 static bool is_subsection_map_empty(struct mem_section *ms) in is_subsection_map_empty() argument
782 struct mem_section *ms = __pfn_to_section(pfn); in section_deactivate() local
783 bool section_is_early = early_section(ms); in section_deactivate()
790 empty = is_subsection_map_empty(ms); in section_deactivate()
799 ms->section_mem_map &= ~SECTION_HAS_MEM_MAP; in section_deactivate()
808 if (!PageReserved(virt_to_page(ms->usage))) { in section_deactivate()
809 kfree_rcu(ms->usage, rcu); in section_deactivate()
810 WRITE_ONCE(ms->usage, NULL); in section_deactivate()
812 memmap = sparse_decode_mem_map(ms->section_mem_map, section_nr); in section_deactivate()
825 ms->section_mem_map = (unsigned long)NULL; in section_deactivate()
832 struct mem_section *ms = __pfn_to_section(pfn); in section_activate() local
837 if (!ms->usage) { in section_activate()
841 ms->usage = usage; in section_activate()
847 ms->usage = NULL; in section_activate()
859 if (nr_pages < PAGES_PER_SECTION && early_section(ms)) in section_activate()
895 struct mem_section *ms; in sparse_add_section() local
913 ms = __nr_to_section(section_nr); in sparse_add_section()
915 __section_mark_present(ms, section_nr); in sparse_add_section()
920 sparse_init_one_section(ms, section_nr, memmap, ms->usage, 0); in sparse_add_section()
928 struct mem_section *ms = __pfn_to_section(pfn); in sparse_remove_section() local
930 if (WARN_ON_ONCE(!valid_section(ms))) in sparse_remove_section()