Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\mempolicy.c Create Date:2022-07-28 15:31:23
Last Modify:2020-03-17 22:28:11 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Step 2: apply policy to a range and do splits.

Proto:static int mbind_range(struct mm_struct *mm, unsigned long start, unsigned long end, struct mempolicy *new_pol)

Type:int

Parameter:

TypeParameterName
struct mm_struct *mm
unsigned longstart
unsigned longend
struct mempolicy *new_pol
753  err = 0
758  vma = Look up the first VMA which satisfies addr < vm_end, NULL if none.
759  VM_BUG_ON(!vma)
761  prev = linked list of VM areas per task, sorted by address
762  If start > Our start address within vm_mm. Then prev = vma
765  When vma && Our start address within vm_mm. < end cycle
766  next = linked list of VM areas per task, sorted by address
767  vmstart = max - return maximum of two values of the same or compatible types*@x: first value*@y: second value(start, Our start address within vm_mm. )
768  vmend = 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. )
770  If mpol_equal(vma_policy(vma), new_pol) Then Continue
773  pgoff = Offset (within vm_file) in PAGE_SIZEunits + ( vmstart - Our start address within vm_mm. >> PAGE_SHIFT determines the page size )
775  prev = Given a mapping request (addr,end,vm_flags,file,pgoff), figure out* whether that can be merged with its predecessor or its successor
778  If prev Then
779  vma = prev
781  If mpol_equal(vma_policy(vma), new_pol) Then Continue
784  Go to replace
788  If err Then Go to out
793  If err Then Go to out
796  replace :
797  err = Apply policy to a single VMA* This must be called with the mmap_sem held for writing.
798  If err Then Go to out
802  out :
803  Return err
Caller
NameDescribe
do_mbind