Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__mm_populate - populate and/or mlock pages within a range of address space.* This is used to implement mlock() and the MAP_POPULATE / MAP_LOCKED mmap* flags. VMAs must be already marked with the desired vm_flags, and* mmap_sem must not be held.

Proto:int __mm_populate(unsigned long start, unsigned long len, int ignore_errors)

Type:int

Parameter:

TypeParameterName
unsigned longstart
unsigned longlen
intignore_errors
1248  mm = mm
1250  struct vm_area_struct * vma = NULL
1251  locked = 0
1252  ret = 0
1254  end = start + len
1256  When nstart < end cycle
1261  If Not locked Then
1262  locked = 1
1265  Else if nstart >= The first byte after our end addresswithin vm_mm. Then vma = linked list of VM areas per task, sorted by address
1267  If Not vma || Our start address within vm_mm. >= end Then Break
1273  nend = min - return minimum of two values of the same or compatible types*@x: first value*@y: second value(end, The first byte after our end addresswithin vm_mm. )
1274  If Flags, see mm.h. & (Memory mapped I/O or similar | Page-ranges managed without "struct page", just pure PFN ) Then Continue
1276  If nstart < Our start address within vm_mm. Then nstart = Our start address within vm_mm.
1283  ret = populate_vma_page_range() - populate a range of pages in the vma
1284  If ret < 0 Then
1285  If ignore_errors Then
1286  ret = 0
1287  Continue
1289  Break
1291  nend = nstart + ret * PAGE_SIZE
1292  ret = 0
1294  If locked Then lease a read lock
1296  Return ret
Caller
NameDescribe
do_mlock
mm_populate