Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/sparse: move __section_mark_present() to internal.h

Let's prepare for moving memory hotplug handling from sparse.c to
sparse-vmemmap.c by moving __section_mark_present() to internal.h.

Link: https://lkml.kernel.org/r/20260320-sparsemem_cleanups-v2-14-096addc8800d@kernel.org
Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Lorenzo Stoakes (Oracle) <ljs@kernel.org>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@kernel.org>
Cc: Wei Xu <weixugc@google.com>
Cc: Yuanchu Xie <yuanchu@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

David Hildenbrand (Arm) and committed by
Andrew Morton
08e5f77c f62a3bf2

+9 -8
+9
mm/internal.h
··· 986 986 ms->section_mem_map |= flags | SECTION_HAS_MEM_MAP; 987 987 ms->usage = usage; 988 988 } 989 + 990 + static inline void __section_mark_present(struct mem_section *ms, 991 + unsigned long section_nr) 992 + { 993 + if (section_nr > __highest_present_section_nr) 994 + __highest_present_section_nr = section_nr; 995 + 996 + ms->section_mem_map |= SECTION_MARKED_PRESENT; 997 + } 989 998 #else 990 999 static inline void sparse_init(void) {} 991 1000 #endif /* CONFIG_SPARSEMEM */
-8
mm/sparse.c
··· 161 161 * those loops early. 162 162 */ 163 163 unsigned long __highest_present_section_nr; 164 - static void __section_mark_present(struct mem_section *ms, 165 - unsigned long section_nr) 166 - { 167 - if (section_nr > __highest_present_section_nr) 168 - __highest_present_section_nr = section_nr; 169 - 170 - ms->section_mem_map |= SECTION_MARKED_PRESENT; 171 - } 172 164 173 165 static inline unsigned long first_present_section_nr(void) 174 166 {