函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\page_alloc.c Create Date:2022-07-27 16:37:56
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Set up the zone data structures:* - mark all pages reserved* - mark all memory queues empty* - clear the memory bitmaps* NOTE: pgdat should get zeroed by caller.* NOTE: this function is only called during early init.

函数原型:static void __init free_area_init_core(struct pglist_data *pgdat)

返回类型:void

参数:

类型参数名称
struct pglist_data *pgdat
6737  nid等于全局结点ID
6739  pgdat_init_internals(pgdat)
6740  per_cpu_nodestats等于boot_nodestats
6742 j小于MAX_NR_ZONES循环
6743  zone等于包含了结点中各内存域的数据结构j
6745  zone_start_pfn等于内存域第一个页帧的索引
6747  size等于内存域中页的总数
6748  freesize等于内存域中实际上可用的页数目
6755  memmap_pages等于calc_memmap_size(size, freesize)
6756  如果非is_highmem_idx(j)则
6757  如果freesize大于等于memmap_pages
6763  否则打印警告信息(" %s zone: %lu pages exceeds freesize %lu\n", zone_names[j], memmap_pages, freesize)
6769  如果j恒等于0且freesize大于dma_reserve
6770  freesize减等于dma_reserve
6775  如果非is_highmem_idx(j)则nr_kernel_pages加等于freesize
6778  否则如果nr_kernel_pages大于memmap_pages乘2则nr_kernel_pages减等于memmap_pages
6780  nr_all_pages加等于freesize
6787  zone_init_internals(zone, j, nid, freesize)
6789  如果非size则继续下一循环
6792  When CONFIG_HUGETLB_PAGE_SIZE_VARIABLE is not set, set_pageblock_order()* is unused as pageblock_order is set at compile-time. See* include/linux/pageblock-flags.h for the values of pageblock_order based on* the kernel config
6793  setup_usemap(pgdat, zone, zone_start_pfn, size)
6794  init_currently_empty_zone(zone, zone_start_pfn, size)
6795  memmap_init(size, nid, j, zone_start_pfn)
调用者
名称描述
free_area_init_node