函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\gup.c Create Date:2022-07-27 16:00:39
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:mmap_sem must be held on entry. If @nonblocking != NULL and* *@flags does not include FOLL_NOWAIT, the mmap_sem may be released.* If it is, *@nonblocking will be set to 0 and -EBUSY returned.

函数原型:static int faultin_page(struct task_struct *tsk, struct vm_area_struct *vma, unsigned long address, unsigned int *flags, int *nonblocking)

返回类型:int

参数:

类型参数名称
struct task_struct *tsk
struct vm_area_struct *vma
unsigned longaddress
unsigned int *flags
int *nonblocking
621  fault_flags等于0
625  如果flags按位与ault in page 按位或lock present pages 的值的值恒等于lock present pages 则返回:负ENOENT
627  如果flags按位与check pte is writable fault_flags或等于Fault was a write access
629  如果flags按位与we are working on non-current tsk/mm fault_flags或等于aulting for non current tsk/mm
631  如果nonblockingfault_flags或等于Retry fault if blocking
633  如果flags按位与 a disk transfer is needed, start the IO* and return without waiting upon it fault_flags或等于Retry fault if blocking 按位或Don't drop mmap_sem and wait when retrying
635  如果flags按位与a retry, previous pass started an IO
636  VM_WARN_ON_ONCE(fault_flags & Retry fault if blocking )
637  fault_flags或等于Second try
640  ret等于handle_mm_fault(vma, address, fault_flags)
641  如果ret按位与VM_FAULT_ERROR
642  err等于NOTE on FOLL_LONGTERM:* FOLL_LONGTERM indicates that the page will be held for an indefinite time* period _often_ under userspace control
644  如果err则返回:err
646  BUG()
649  如果tsk
650  如果ret按位与VM_FAULT_MAJORmaj_flt自加
652  否则min_flt自加
656  如果ret按位与VM_FAULT_RETRY
657  如果nonblocking且非fault_flags按位与Don't drop mmap_sem and wait when retrying 的值则nonblocking等于0
659  返回:负EBUSY
671  如果ret按位与VM_FAULT_WRITE且非Flags, see mm.h. 按位与VM_WRITE的值则flags或等于rnal GUP flag
673  返回:0
调用者
名称描述
__get_user_pages__get_user_pages() - pin user pages in memory*@tsk: task_struct of target task*@mm: mm_struct of target mm*@start: starting user address*@nr_pages: number of pages from start to pin*@gup_flags: flags modifying pin behaviour