Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\sparse.c Create Date:2022-07-28 15:34:53
Last Modify:2020-03-17 22:36:03 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:sparse_add_section - add a memory section, or populate an existing one*@nid: The node to add section on*@start_pfn: start pfn of the memory range*@nr_pages: number of pfns to add in the section*@altmap: device page map* This is only intended for hotplug

Proto:int __meminit sparse_add_section(int nid, unsigned long start_pfn, unsigned long nr_pages, struct vmem_altmap *altmap)

Type:int

Parameter:

TypeParameterName
intnid
unsigned longstart_pfn
unsigned longnr_pages
struct vmem_altmap *altmap
872  section_nr = pfn_to_section_nr(start_pfn)
877  ret = sparse_index_init(section_nr, nid)
878  If ret < 0 Then Return ret
881  memmap = section_activate(nid, start_pfn, nr_pages, altmap)
882  If IS_ERR(memmap) Then Return PTR_ERR(memmap)
889  page_init_poison(memmap, sizeof(structpage) * nr_pages)
891  ms = __nr_to_section(section_nr)
892  set_section_nid(section_nr, nid)
893  section_mark_present(ms)
896  If section_nr_to_pfn(section_nr) != start_pfn Then memmap = pfn_to_kaddr(section_nr_to_pfn(section_nr))
898  sparse_init_one_section(ms, section_nr, memmap, usage, 0)
900  Return 0