Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\page_alloc.c Create Date:2022-07-28 15:07:45
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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.

Proto:static void __init free_area_init_core(struct pglist_data *pgdat)

Type:void

Parameter:

TypeParameterName
struct pglist_data *pgdat
6737  nid = node_id
6739  pgdat_init_internals(pgdat)
6740  per_cpu_nodestats = boot_nodestats
6742  When j < MAX_NR_ZONES cycle
6743  zone = node_zones + j
6745  zone_start_pfn = zone_start_pfn == zone_start_paddr >> PAGE_SHIFT
6747  size = spanned_pages
6748  freesize = present_pages
6755  memmap_pages = calc_memmap_size(size, freesize)
6756  If Not is_highmem_idx(j) Then
6757  If freesize >= memmap_pages Then
6763  Else pr_warn(" %s zone: %lu pages exceeds freesize %lu\n", zone_names[j], memmap_pages, freesize)
6769  If j == 0 && freesize > dma_reserve Then
6770  freesize -= dma_reserve
6775  If Not is_highmem_idx(j) Then nr_kernel_pages += freesize
6778  Else if nr_kernel_pages > memmap_pages * 2 Then nr_kernel_pages -= memmap_pages
6780  nr_all_pages += freesize
6787  zone_init_internals(zone, j, nid, freesize)
6789  If Not size Then Continue
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)
Caller
NameDescribe
free_area_init_node