Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__vma_reservation_common

Proto:static long __vma_reservation_common(struct hstate *h, struct vm_area_struct *vma, unsigned long addr, enum vma_resv_mode mode)

Type:long

Parameter:

TypeParameterName
struct hstate *h
struct vm_area_struct *vma
unsigned longaddr
enum vma_resv_modemode
1874  resv = vma_resv_map(vma)
1875  If Not resv Then Return 1
1878  idx = Convert the address within this vma to the page offset within* the mapping, in pagecache page units; huge pages here.
1880  Case 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  Break
1883  Case mode == VMA_COMMIT_RESV
1884  ret = Add the huge page range represented by [f, t) to the reserve* map
1885  Break
1886  Case 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  Break
1890  Case mode == VMA_ADD_RESV
1891  If Flags, see mm.h. & VM_MAYSHARE Then ret = Add the huge page range represented by [f, t) to the reserve* map
1893  Else
1897  Break
1898  Default
1899  BUG()
1902  If Flags, see mm.h. & VM_MAYSHARE Then Return ret
1904  Else if 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 Then
1918  If ret Then Return 0
1920  Else Return 1
1923  Else Return If ret < 0 Then ret Else 0
Caller
NameDescribe
vma_needs_reservation
vma_commit_reservation
vma_end_reservation
vma_add_reservation