函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:__mcopy_atomic processing for HUGETLB vmas. Note that this routine is* called with mmap_sem held, it will release mmap_sem before returning.

函数原型:static __always_inline ssize_t __mcopy_atomic_hugetlb(struct mm_struct *dst_mm, struct vm_area_struct *dst_vma, unsigned long dst_start, unsigned long src_start, unsigned long len, bool zeropage)

返回类型:ssize_t

参数:

类型参数名称
struct mm_struct *dst_mm
struct vm_area_struct *dst_vma
unsigned longdst_start
unsigned longsrc_start
unsigned longlen
boolzeropage
210  vm_alloc_shared等于Flags, see mm.h. 按位与VM_SHARED
211  vm_shared等于Flags, see mm.h. 按位与VM_SHARED
228  如果zeropage
229  lease a read lock
230  返回:负EINVAL
233  src_addr等于src_start
234  dst_addr等于dst_start
235  copied等于0
236  page = NULL
237  vma_hpagesize等于Return the size of the pages allocated when backing a VMA. In the majority* cases this will be same size as used by the page table entries.
242  err等于负EINVAL
243  如果dst_start按位与vma_hpagesize减1或len按位与vma_hpagesize减1则转到:out_unlock
246  retry :
251  如果非dst_vma
252  err等于负ENOENT
253  dst_vma等于find_dst_vma(dst_mm, dst_start, len)
254  如果非dst_vma或非is_vm_hugetlb_page(dst_vma)则转到:out_unlock
257  err等于负EINVAL
258  如果vma_hpagesize不等于Return the size of the pages allocated when backing a VMA. In the majority* cases this will be same size as used by the page table entries.则转到:out_unlock
261  vm_shared等于Flags, see mm.h. 按位与VM_SHARED
267  err等于负ENOMEM
268  如果非vm_shared
269  如果此条件成立可能性小(为编译器优化)(anon_vma_prepare(dst_vma))则转到:out_unlock
273 src_addr小于src_startlen循环
276  BUG_ON(dst_addr >= dst_start + len)
281  idx等于linear_page_index(dst_vma, dst_addr)
282  mapping等于f_mapping
283  hash等于For uniprocesor systems we always use a single mutex, so just* return 0 and avoid the hashing overhead.
284  mutex_lock( & hugetlb_fault_mutex_table[hash])
286  err等于负ENOMEM
287  dst_pte等于arch callbacks
288  如果非dst_pte
290  转到:out_unlock
293  err等于负EEXIST
294  dst_pteval等于huge_ptep_get(dst_pte)
295  如果非huge_pte_none(dst_pteval)则
297  转到:out_unlock
300  err等于Used by userfaultfd UFFDIO_COPY. Based on mcopy_atomic_pte with* modifications for huge pages.
303  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
304  vm_alloc_shared等于vm_shared
306  cond_resched()
310  BUG_ON(!page)
317  err等于负EFAULT
318  转到:out
322  dst_vma = NULL
323  转到:retry
324  否则BUG_ON(page)
327  如果非err
328  dst_addr加等于vma_hpagesize
329  src_addr加等于vma_hpagesize
330  copied加等于vma_hpagesize
332  如果fatal_signal_pending(当前进程)则err等于负EINTR
335  如果err退出
339  out_unlock :
340  lease a read lock
341  out :
342  如果page
384  如果vm_alloc_sharedPrivate page markings that may be used by the filesystem that owns the page* for its own purposes.* - PG_private and PG_private_2 cause releasepage() and co to be invoked
386  否则Private page markings that may be used by the filesystem that owns the page* for its own purposes.* - PG_private and PG_private_2 cause releasepage() and co to be invoked
388  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
390  BUG_ON(copied < 0)
391  BUG_ON(err > 0)
392  BUG_ON(!copied && !err)
393  返回:如果copiedcopied否则err
调用者
名称描述
__mcopy_atomic