Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__vmalloc_area_node

Proto:static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask, pgprot_t prot, int node)

Type:void

Parameter:

TypeParameterName
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 = If gfp_mask & (GFP_DMA | GFP_DMA32) Then 0 Else __GFP_HIGHMEM
2458  nr_pages = Lowlevel-APIs (not for driver use!) >> PAGE_SHIFT determines the page size
2459  array_size = nr_pages * size of *
2462  If array_size > PAGE_SIZE Then
2463  pages = __vmalloc_node(array_size, 1, nested_gfp | highmem_mask, PAGE_KERNEL, node, caller)
2465  Else
2466  pages = kmalloc_node(array_size, nested_gfp, node)
2469  If Not pages Then
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  kfree(area)
2472  Return NULL
2475  pages = pages
2476  nr_pages = nr_pages
2478  When i < nr_pages cycle
2481  If node == NUMA_NO_NODE Then page = alloc_page(alloc_mask | highmem_mask)
2483  Else 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  Go to fail
2492  pages[i] = page
2493  If gfpflags_allow_blocking(gfp_mask) Then cond_resched()
2496  atomic_long_add(nr_pages, & nr_vmalloc_pages)
2498  If map_vm_area(area, prot, pages) Then Go to fail
2500  Return 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  Return NULL
Caller
NameDescribe
__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