Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:unmapped_area_topdown

Proto:unsigned long unmapped_area_topdown(struct vm_unmapped_area_info *info)

Type:unsigned long

Parameter:

TypeParameterName
struct vm_unmapped_area_info *info
1960  mm = mm
1965  length = length + align_mask
1966  If length < length Then Return -ENOMEM
1973  gap_end = high_limit
1974  If gap_end < length Then Return -ENOMEM
1976  high_limit = gap_end - length
1978  If low_limit > high_limit Then Return -ENOMEM
1980  low_limit = low_limit + length
1983  gap_start = highest vma end address
1984  If gap_start <= high_limit Then Go to found_highest
1988  If RB_EMPTY_ROOT( & mm_rb) Then Return -ENOMEM
1990  vma = rb_entry(rb_node, structvm_area_struct, vm_rb)
1991  If Largest free memory gap in bytes to the left of this VMA.* Either between this VMA and vma->vm_prev, or between one of the* VMAs below us in the VMA rbtree and its ->vm_prev. This helps* get_unmapped_area find a free area of the right size. < length Then Return -ENOMEM
1994  When (true) cycle
1996  gap_start = If linked list of VM areas per task, sorted by address Then vm_end_gap(linked list of VM areas per task, sorted by address ) Else 0
1997  If gap_start <= high_limit && rb_right Then
2002  vma = right
2003  Continue
2007  check_current :
2009  gap_end = vm_start_gap(vma)
2010  If gap_end < low_limit Then Return -ENOMEM
2012  If gap_start <= high_limit && gap_end > gap_start && gap_end - gap_start >= length Then Go to found
2017  If rb_left Then
2022  vma = left
2023  Continue
2028  When (true) cycle
2029  prev = vm_rb
2030  If Not rb_parent(prev) Then Return -ENOMEM
2034  If prev == rb_right Then
2042  found :
2044  If gap_end > high_limit Then gap_end = high_limit
2047  found_highest :
2049  gap_end -= length
2050  gap_end -= gap_end - align_offset & align_mask
2052  VM_BUG_ON(gap_end < low_limit)
2053  VM_BUG_ON(gap_end < gap_start)
2054  Return gap_end
Caller
NameDescribe
vm_unmapped_areaSearch for an unmapped address range