Lines Matching refs:ms
112 unsigned long __section_nr(struct mem_section *ms) in __section_nr() argument
122 if ((ms >= root) && (ms < (root + SECTIONS_PER_ROOT))) in __section_nr()
128 return (root_nr * SECTIONS_PER_ROOT) + (ms - root); in __section_nr()
131 unsigned long __section_nr(struct mem_section *ms) in __section_nr() argument
133 return (unsigned long)(ms - mem_section[0]); in __section_nr()
189 static void section_mark_present(struct mem_section *ms) in section_mark_present() argument
191 unsigned long section_nr = __section_nr(ms); in section_mark_present()
196 ms->section_mem_map |= SECTION_MARKED_PRESENT; in section_mark_present()
229 struct mem_section *ms; in subsection_map_init() local
234 ms = __nr_to_section(nr); in subsection_map_init()
235 subsection_mask_set(ms->usage->subsection_map, pfn, pfns); in subsection_map_init()
273 struct mem_section *ms; in memory_present() local
278 ms = __nr_to_section(section); in memory_present()
279 if (!ms->section_mem_map) { in memory_present()
280 ms->section_mem_map = sparse_encode_early_nid(nid) | in memory_present()
282 section_mark_present(ms); in memory_present()
327 static void __meminit sparse_init_one_section(struct mem_section *ms, in sparse_init_one_section() argument
331 ms->section_mem_map &= ~SECTION_MAP_MASK; in sparse_init_one_section()
332 ms->section_mem_map |= sparse_encode_mem_map(mem_map, pnum) in sparse_init_one_section()
334 ms->usage = usage; in sparse_init_one_section()
563 struct mem_section *ms; in sparse_init_nid() local
567 ms = __nr_to_section(pnum); in sparse_init_nid()
568 ms->section_mem_map = 0; in sparse_init_nid()
616 struct mem_section *ms; in online_mem_sections() local
622 ms = __nr_to_section(section_nr); in online_mem_sections()
623 ms->section_mem_map |= SECTION_IS_ONLINE; in online_mem_sections()
635 struct mem_section *ms; in offline_mem_sections() local
644 ms = __nr_to_section(section_nr); in offline_mem_sections()
645 ms->section_mem_map &= ~SECTION_IS_ONLINE; in offline_mem_sections()
677 struct mem_section *ms = __pfn_to_section(pfn); in clear_subsection_map() local
678 unsigned long *subsection_map = ms->usage in clear_subsection_map()
679 ? &ms->usage->subsection_map[0] : NULL; in clear_subsection_map()
694 static bool is_subsection_map_empty(struct mem_section *ms) in is_subsection_map_empty() argument
696 return bitmap_empty(&ms->usage->subsection_map[0], in is_subsection_map_empty()
702 struct mem_section *ms = __pfn_to_section(pfn); in fill_subsection_map() local
709 subsection_map = &ms->usage->subsection_map[0]; in fill_subsection_map()
770 static bool is_subsection_map_empty(struct mem_section *ms) in is_subsection_map_empty() argument
800 struct mem_section *ms = __pfn_to_section(pfn); in section_deactivate() local
801 bool section_is_early = early_section(ms); in section_deactivate()
808 empty = is_subsection_map_empty(ms); in section_deactivate()
817 ms->section_mem_map &= ~SECTION_HAS_MEM_MAP; in section_deactivate()
826 if (!PageReserved(virt_to_page(ms->usage))) { in section_deactivate()
827 kfree_rcu(ms->usage, rcu); in section_deactivate()
828 WRITE_ONCE(ms->usage, NULL); in section_deactivate()
830 memmap = sparse_decode_mem_map(ms->section_mem_map, section_nr); in section_deactivate()
843 ms->section_mem_map = (unsigned long)NULL; in section_deactivate()
849 struct mem_section *ms = __pfn_to_section(pfn); in section_activate() local
854 if (!ms->usage) { in section_activate()
858 ms->usage = usage; in section_activate()
864 ms->usage = NULL; in section_activate()
876 if (nr_pages < PAGES_PER_SECTION && early_section(ms)) in section_activate()
910 struct mem_section *ms; in sparse_add_section() local
928 ms = __nr_to_section(section_nr); in sparse_add_section()
930 section_mark_present(ms); in sparse_add_section()
935 sparse_init_one_section(ms, section_nr, memmap, ms->usage, 0); in sparse_add_section()
967 void sparse_remove_section(struct mem_section *ms, unsigned long pfn, in sparse_remove_section() argument