Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\nommu.c Create Date:2022-07-28 14:37:46
Last Modify:2020-03-17 21:26:27 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:shrink a VMA by removing the specified chunk from either the beginning or* the end

Proto:static int shrink_vma(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long from, unsigned long to)

Type:int

Parameter:

TypeParameterName
struct mm_struct *mm
struct vm_area_struct *vma
unsigned longfrom
unsigned longto
1455  delete a VMA from its owning mm_struct and address space
1456  If from > Our start address within vm_mm. Then The first byte after our end addresswithin vm_mm. = from
1458  Else Our start address within vm_mm. = to
1460  add a VMA into a process's mm_struct in the appropriate place in the list* and tree and add to the address space's page tree also if not an anonymous* page* - should be called with mm->mmap_sem held writelocked
1463  region = vm_region
1464  BUG_ON(gion usage count (access under nommu_region_sem) != 1)
1466  lock for writing
1467  delete a region from the global tree
1468  If from > start address of region Then
1469  to = gion allocated to here
1470  gion allocated to here = gion initialised to here = from
1471  Else
1472  start address of region = to
1474  add a region into the global tree
1475  lease a write lock
1477  a contiguous series of pages
1478  Return 0
Caller
NameDescribe
do_munmaplease a mapping* - under NOMMU conditions the chunk to be unmapped must be backed by a single* VMA, though it need not cover the whole VMA