Lines Matching +full:1 +full:ms

24  * 1) mem_section	- memory sections, mem_map's for valid memory
132 unsigned long max_sparsemem_pfn = (DIRECT_MAP_PHYSMEM_END + 1) >> PAGE_SHIFT; in mminit_validate_memmodel_limits()
142 WARN_ON_ONCE(1); in mminit_validate_memmodel_limits()
149 WARN_ON_ONCE(1); in mminit_validate_memmodel_limits()
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()
174 for (section_nr = next_present_section_nr(start-1); \
175 section_nr != -1; \
180 return next_present_section_nr(-1); in first_present_section_nr()
188 int end = subsection_map_index(pfn + nr_pages - 1); in subsection_mask_set()
190 bitmap_set(map, idx, end - idx + 1); in subsection_mask_set()
195 int end_sec_nr = pfn_to_section_nr(pfn + nr_pages - 1); in subsection_map_init()
199 struct mem_section *ms; in subsection_map_init() local
204 ms = __nr_to_section(nr); in subsection_map_init()
205 subsection_mask_set(ms->usage->subsection_map, pfn, pfns); in subsection_map_init()
209 subsection_map_index(pfn + pfns - 1)); in subsection_map_init()
230 struct mem_section *ms; in memory_present() local
235 ms = __nr_to_section(section_nr); in memory_present()
236 if (!ms->section_mem_map) { in memory_present()
237 ms->section_mem_map = sparse_encode_early_nid(nid) | in memory_present()
239 __section_mark_present(ms, section_nr); in memory_present()
259 align = 1 << (INTERNODE_CACHE_SHIFT); in memblocks_present()
294 static void __meminit sparse_init_one_section(struct mem_section *ms, in sparse_init_one_section() argument
298 ms->section_mem_map &= ~SECTION_MAP_MASK; in sparse_init_one_section()
299 ms->section_mem_map |= sparse_encode_mem_map(mem_map, pnum) in sparse_init_one_section()
301 ms->usage = usage; in sparse_init_one_section()
343 limit = goal + (1UL << PA_SECTION_SHIFT); in sparse_early_usemaps_alloc_pgdat_section()
542 struct mem_section *ms; in sparse_init_nid() local
546 ms = __nr_to_section(pnum); in sparse_init_nid()
547 ms->section_mem_map = 0; in sparse_init_nid()
557 unsigned long pnum_end, pnum_begin, map_count = 1; in sparse_init()
570 for_each_present_section_nr(pnum_begin + 1, pnum_end) { in sparse_init()
581 map_count = 1; in sparse_init()
597 struct mem_section *ms; in online_mem_sections() local
603 ms = __nr_to_section(section_nr); in online_mem_sections()
604 ms->section_mem_map |= SECTION_IS_ONLINE; in online_mem_sections()
615 struct mem_section *ms; in offline_mem_sections() local
624 ms = __nr_to_section(section_nr); in offline_mem_sections()
625 ms->section_mem_map &= ~SECTION_IS_ONLINE; in offline_mem_sections()
643 memmap_pages_add(-1L * (DIV_ROUND_UP(end - start, PAGE_SIZE))); in depopulate_section_memmap()
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
767 * 1. deactivation of a partial hot-added section (only possible in
774 * For 1, when subsection_map does not empty we will not be freeing the
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()
797 * ms->usage array. 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
914 ms = __nr_to_section(section_nr); in sparse_add_section()
916 __section_mark_present(ms, section_nr); in sparse_add_section()
921 sparse_init_one_section(ms, section_nr, memmap, ms->usage, 0); in sparse_add_section()
929 struct mem_section *ms = __pfn_to_section(pfn); in sparse_remove_section() local
931 if (WARN_ON_ONCE(!valid_section(ms))) in sparse_remove_section()