函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\mempolicy.c Create Date:2022-07-27 17:04:05
Last Modify:2020-03-17 22:28:11 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Step 2: apply policy to a range and do splits.

函数原型:static int mbind_range(struct mm_struct *mm, unsigned long start, unsigned long end, struct mempolicy *new_pol)

返回类型:int

参数:

类型参数名称
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  如果start大于Our start address within vm_mm. prev等于vma
765 vmaOur start address within vm_mm. 小于end循环
766  next等于linked list of VM areas per task, sorted by address
767  vmstart等于两数取大(start, Our start address within vm_mm. )
768  vmend等于两数取小(end, The first byte after our end addresswithin vm_mm. )
770  如果mpol_equal(vma_policy(vma), new_pol)则继续下一循环
773  pgoff等于Offset (within vm_file) in PAGE_SIZEunits vmstartOur 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  如果prev
779  vma等于prev
781  如果mpol_equal(vma_policy(vma), new_pol)则继续下一循环
784  转到:replace
786  如果Our start address within vm_mm. 不等于vmstart
788  如果err则转到:out
793  如果err则转到:out
796  replace :
797  err等于Apply policy to a single VMA* This must be called with the mmap_sem held for writing.
798  如果err则转到:out
802  out :
803  返回:err
调用者
名称描述
do_mbind