函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__vma_reservation_common

函数原型:static long __vma_reservation_common(struct hstate *h, struct vm_area_struct *vma, unsigned long addr, enum vma_resv_mode mode)

返回类型:long

参数:

类型参数名称
struct hstate *h
struct vm_area_struct *vma
unsigned longaddr
enum vma_resv_modemode
1874  resv等于vma_resv_map(vma)
1875  如果非resv则返回:1
1878  idx等于Convert the address within this vma to the page offset within* the mapping, in pagecache page units; huge pages here.
1880  :mode恒等于VMA_NEEDS_RESV
1881  ret等于Examine the existing reserve map and determine how many* huge pages in the specified range [f, t) are NOT currently* represented. This routine is called before a subsequent* call to region_add that will actually modify the reserve
1882  退出
1883  :mode恒等于VMA_COMMIT_RESV
1884  ret等于Add the huge page range represented by [f, t) to the reserve* map
1885  退出
1886  :mode恒等于VMA_END_RESV
1887  Abort the in progress add operation. The adds_in_progress field* of the resv_map keeps track of the operations in progress between* calls to region_chg and region_add. Operations are sometimes* aborted after the call to region_chg
1888  ret等于0
1889  退出
1890  :mode恒等于VMA_ADD_RESV
1891  如果Flags, see mm.h. 按位与VM_MAYSHAREret等于Add the huge page range represented by [f, t) to the reserve* map
1893  否则
1897  退出
1898  默认
1899  BUG()
1902  如果Flags, see mm.h. 按位与VM_MAYSHARE则返回:ret
1904  否则如果is_vma_resv_set(vma, Flags for MAP_PRIVATE reservations. These are stored in the bottom* bits of the reservation map pointer, which are always clear due to* alignment.)且ret大于等于0则
1918  如果ret则返回:0
1920  否则返回:1
1923  否则返回:如果ret小于0则ret否则0
调用者
名称描述
vma_needs_reservation
vma_commit_reservation
vma_end_reservation
vma_add_reservation