函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\sparse.c Create Date:2022-07-27 17:08:09
Last Modify:2020-03-17 22:36:03 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:section_activate

函数原型:static struct page *__meminit section_activate(int nid, unsigned long pfn, unsigned long nr_pages, struct vmem_altmap *altmap)

返回类型:struct page

参数:

类型参数名称
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  如果非usage
814  usage等于分配内存并置零
815  如果非usage则返回:错误号
817  usage等于usage
819  subsection_map等于subsection_map[0]
821  如果bitmap_empty(map, SUBSECTIONS_PER_SECTION)则rc等于负EINVAL
823  否则如果bitmap_intersects(map, subsection_map, SUBSECTIONS_PER_SECTION)则rc等于负EEXIST
825  否则bitmap_or(subsection_map, map, subsection_map, SUBSECTIONS_PER_SECTION)
829  如果rc
830  如果usageusage = NULL
832  释放内存
833  返回:错误号
843  如果nr_pages小于PAGES_PER_SECTIONearly_section(ms)则返回:pfn_to_page(pfn)
846  memmap等于populate_section_memmap(pfn, nr_pages, nid, altmap)
847  如果非memmap
848  section_deactivate(pfn, nr_pages, altmap)
849  返回:错误号
852  返回:memmap
调用者
名称描述
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