Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Initialize sparse on a specific node. The node spans [pnum_begin, pnum_end)* And number of present sections in this node is map_count.

Proto:static void __init sparse_init_nid(int nid, unsigned long pnum_begin, unsigned long pnum_end, unsigned long map_count)

Type:void

Parameter:

TypeParameterName
intnid
unsigned longpnum_begin
unsigned longpnum_end
unsigned longmap_count
537  usage = sparse_early_usemaps_alloc_pgdat_section(NODE_DATA(nid), mem_section_usage_size() * map_count)
539  If Not usage Then
540  pr_err("%s: node[%d] usemap allocation failed", __func__, nid)
541  Go to failed
543  sparse_buffer_init(map_count * section_map_size(), nid)
545  pfn = section_nr_to_pfn(pnum)
547  If pnum >= pnum_end Then Break
550  map = __populate_section_memmap(pfn, PAGES_PER_SECTION, nid, NULL)
552  If Not map Then
553  pr_err("%s: node[%d] memory map backing failed. Some memory will not be available.", __func__, nid)
555  pnum_begin = pnum
556  Go to failed
558  check_usemap_section_nr(nid, usage)
559  sparse_init_one_section(__nr_to_section(pnum), pnum, map, usage, SECTION_IS_EARLY)
561  usage = usage + mem_section_usage_size()
563  sparse_buffer_fini()
564  Return
565  failed :
570  If pnum >= pnum_end Then Break
572  ms = __nr_to_section(pnum)
573  section_mem_map = 0
Caller
NameDescribe
sparse_initAllocate the accumulated non-linear sections, allocate a mem_map* for each and record the physical to section mapping.