Lines Matching +full:0 +full:ms
95 return 0; in sparse_index_init()
103 return 0; in sparse_index_init()
108 return 0; in sparse_index_init()
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()
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()
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()
262 panic("%s: Failed to allocate %lu bytes align=0x%lx\n", in memblocks_present()
297 static void __meminit sparse_init_one_section(struct mem_section *ms, in sparse_init_one_section() argument
301 ms->section_mem_map &= ~SECTION_MAP_MASK; in sparse_init_one_section()
302 ms->section_mem_map |= sparse_encode_mem_map(mem_map, pnum) in sparse_init_one_section()
304 ms->usage = usage; in sparse_init_one_section()
438 panic("%s: Failed to allocate %lu bytes align=0x%lx nid=%d from=%pa\n", in __populate_section_memmap()
450 WARN_ON(!sparsemap_buf || size == 0); in sparse_buffer_free()
474 if (sparsemap_buf && size > 0) in sparse_buffer_fini()
489 if ((unsigned long)(ptr - sparsemap_buf) > 0) in sparse_buffer_alloc()
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()
600 struct mem_section *ms; in online_mem_sections() local
606 ms = __nr_to_section(section_nr); in online_mem_sections()
607 ms->section_mem_map |= SECTION_IS_ONLINE; in online_mem_sections()
618 struct mem_section *ms; in offline_mem_sections() local
627 ms = __nr_to_section(section_nr); in offline_mem_sections()
628 ms->section_mem_map &= ~SECTION_IS_ONLINE; in offline_mem_sections()
659 DECLARE_BITMAP(map, SUBSECTIONS_PER_SECTION) = { 0 }; in clear_subsection_map()
660 DECLARE_BITMAP(tmp, SUBSECTIONS_PER_SECTION) = { 0 }; in clear_subsection_map()
661 struct mem_section *ms = __pfn_to_section(pfn); in clear_subsection_map() local
662 unsigned long *subsection_map = ms->usage in clear_subsection_map()
663 ? &ms->usage->subsection_map[0] : NULL; in clear_subsection_map()
675 return 0; in clear_subsection_map()
678 static bool is_subsection_map_empty(struct mem_section *ms) in is_subsection_map_empty() argument
680 return bitmap_empty(&ms->usage->subsection_map[0], in is_subsection_map_empty()
686 struct mem_section *ms = __pfn_to_section(pfn); in fill_subsection_map() local
687 DECLARE_BITMAP(map, SUBSECTIONS_PER_SECTION) = { 0 }; in fill_subsection_map()
689 int rc = 0; in fill_subsection_map()
693 subsection_map = &ms->usage->subsection_map[0]; in fill_subsection_map()
729 for (i = 0; i < nr_pages; i++, page++) { in free_map_bootmem()
752 return 0; in clear_subsection_map()
755 static bool is_subsection_map_empty(struct mem_section *ms) in is_subsection_map_empty() argument
762 return 0; in fill_subsection_map()
785 struct mem_section *ms = __pfn_to_section(pfn); in section_deactivate() local
786 bool section_is_early = early_section(ms); in section_deactivate()
793 empty = is_subsection_map_empty(ms); in section_deactivate()
800 * ms->usage array. in section_deactivate()
802 ms->section_mem_map &= ~SECTION_HAS_MEM_MAP; in section_deactivate()
811 if (!PageReserved(virt_to_page(ms->usage))) { in section_deactivate()
812 kfree_rcu(ms->usage, rcu); in section_deactivate()
813 WRITE_ONCE(ms->usage, NULL); in section_deactivate()
815 memmap = sparse_decode_mem_map(ms->section_mem_map, section_nr); in section_deactivate()
828 ms->section_mem_map = (unsigned long)NULL; in section_deactivate()
835 struct mem_section *ms = __pfn_to_section(pfn); in section_activate() local
840 if (!ms->usage) { in section_activate()
844 ms->usage = usage; in section_activate()
850 ms->usage = NULL; in section_activate()
862 if (nr_pages < PAGES_PER_SECTION && early_section(ms)) in section_activate()
889 * * 0 - On success.
898 struct mem_section *ms; in sparse_add_section() local
903 if (ret < 0) in sparse_add_section()
917 ms = __nr_to_section(section_nr); in sparse_add_section()
919 __section_mark_present(ms, section_nr); in sparse_add_section()
924 sparse_init_one_section(ms, section_nr, memmap, ms->usage, 0); in sparse_add_section()
926 return 0; in sparse_add_section()
932 struct mem_section *ms = __pfn_to_section(pfn); in sparse_remove_section() local
934 if (WARN_ON_ONCE(!valid_section(ms))) in sparse_remove_section()