函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__vmalloc_area_node

函数原型:static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask, pgprot_t prot, int node)

返回类型:void

参数:

类型参数名称
struct vm_struct *area
gfp_tgfp_mask
pgprot_tprot
intnode
2452  nested_gfp等于gfp_mask按位与The set of flags that only affect watermark checking and reclaim* behaviour. This is used by the MM to obey the caller constraints* about IO, FS and watermark checking while ignoring placement* hints such as HIGHMEM usage.按位或__GFP_ZERO
2453  alloc_mask等于gfp_mask按位或DOC: Action modifiers* Action modifiers* ~~~~~~~~~~~~~~~~* %__GFP_NOWARN suppresses allocation failure reports.* %__GFP_COMP address compound page metadata.* %__GFP_ZERO returns a zeroed page on success.
2454  highmem_mask等于如果gfp_mask按位与GFP_DMA按位或GFP_DMA32的值则0否则__GFP_HIGHMEM
2458  nr_pages等于Lowlevel-APIs (not for driver use!)右移PAGE_SHIFT determines the page size
2459  array_size等于nr_pages乘*的长度
2462  如果array_size大于PAGE_SIZE
2463  pages等于__vmalloc_node(array_size, 1, nested_gfp | highmem_mask, PAGE_KERNEL, node, caller)
2465  否则
2466  pages等于kmalloc_node(array_size, nested_gfp, node)
2469  如果非pages
2470  move_vm_area - find and remove a continuous kernel virtual area*@addr: base address* Search for the kernel VM area starting at @addr, and remove it.* This function returns the found VM area, but using it is NOT safe
2471  释放内存
2472  返回:NULL
2475  pages等于pages
2476  nr_pages等于nr_pages
2478 i小于nr_pages循环
2481  如果node恒等于NUMA_NO_NODEpage等于alloc_page(alloc_mask | highmem_mask)
2483  否则page等于Allocate pages, preferring the node given as nid. When nid == NUMA_NO_NODE,* prefer the current CPU's closest node. Otherwise node must be valid and* online.
2488  nr_pages等于i
2490  转到:fail
2492  pages[i]等于page
2493  如果gfpflags_allow_blocking(gfp_mask)则cond_resched()
2496  atomic_long_add(nr_pages, & nr_vmalloc_pages)
2498  如果map_vm_area(area, prot, pages)则转到:fail
2500  返回:addr
2502  fail :
2503  warn_alloc(gfp_mask, NULL, "vmalloc: allocation failure, allocated %ld of %ld bytes", (nr_pages * PAGE_SIZE), size)
2506  __vfree(addr)
2507  返回:NULL
调用者
名称描述
__vmalloc_node_range__vmalloc_node_range - allocate virtually contiguous memory*@size: allocation size*@align: desired alignment*@start: vm area range start*@end: vm area range end*@gfp_mask: flags for the page level allocator*@prot: protection mask for the allocated pages