Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:section_activate

Proto:static struct page *__meminit section_activate(int nid, unsigned long pfn, unsigned long nr_pages, struct vmem_altmap *altmap)

Type:struct page

Parameter:

TypeParameterName
intnid
unsigned longpfn
unsigned longnr_pages
struct vmem_altmap *altmap
804  DECLARE_BITMAP(map, SUBSECTIONS_PER_SECTION) = {0}
805  ms = __pfn_to_section(pfn)
806  struct usage = NULL
809  rc = 0
811  subsection_mask_set(map, pfn, nr_pages)
813  If Not usage Then
814  usage = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
815  If Not usage Then Return ERR_PTR( - ENOMEM)
817  usage = usage
819  subsection_map = subsection_map[0]
821  If bitmap_empty(map, SUBSECTIONS_PER_SECTION) Then rc = -EINVAL
823  Else if bitmap_intersects(map, subsection_map, SUBSECTIONS_PER_SECTION) Then rc = -EEXIST
825  Else bitmap_or(subsection_map, map, subsection_map, SUBSECTIONS_PER_SECTION)
829  If rc Then
830  If usage Then usage = NULL
832  kfree(usage)
833  Return ERR_PTR(rc)
843  If nr_pages < PAGES_PER_SECTION && early_section(ms) Then Return pfn_to_page(pfn)
846  memmap = populate_section_memmap(pfn, nr_pages, nid, altmap)
847  If Not memmap Then
848  section_deactivate(pfn, nr_pages, altmap)
849  Return ERR_PTR( - ENOMEM)
852  Return memmap
Caller
NameDescribe
sparse_add_sectionsparse_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