函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:mcopy_atomic_pte

函数原型:static int mcopy_atomic_pte(struct mm_struct *dst_mm, pmd_t *dst_pmd, struct vm_area_struct *dst_vma, unsigned long dst_addr, unsigned long src_addr, struct page **pagep)

返回类型:int

参数:

类型参数名称
struct mm_struct *dst_mm
pmd_t *dst_pmd
struct vm_area_struct *dst_vma
unsigned longdst_addr
unsigned longsrc_addr
struct page **pagep
67  如果非pagep
68  ret等于负ENOMEM
69  page等于alloc_page_vma(GFP_HIGHUSER_MOVABLE, dst_vma, dst_addr)
70  如果非page则转到:out
73  page_kaddr等于kmap_atomic(page)
74  ret等于copy_from_user(page_kaddr, (constvoid__user * )src_addr, PAGE_SIZE)
77  Prevent people trying to call kunmap_atomic() as if it were kunmap()* kunmap_atomic() should get the return value of kmap_atomic, not the page.(page_kaddr)
81  ret等于负ENOENT
82  pagep等于page
84  转到:out
86  否则
87  page等于pagep
88  * pagep = NULL
96  __SetPageUptodate(page)
98  ret等于负ENOMEM
99  如果mem_cgroup_try_charge - try charging a page*@page: page to charge*@mm: mm context of the victim*@gfp_mask: reclaim mode*@memcgp: charged memcg return*@compound: charge the page as compound or small page* Try to charge @page to the memcg that @mm belongs 则转到:out_release
102  _dst_pte等于Conversion functions: convert a page and protection to a page entry,* and a page entry and page directory to the page they refer to.* (Currently stuck as a macro because of indirect forward reference* to linux/mm.h:page_to_nid())(page, Access permissions of this VMA. )
103  如果Flags, see mm.h. 按位与VM_WRITE_dst_pte等于pte_mkwrite(pte_mkdirty(_dst_pte))
106  dst_pte等于pte_offset_map_lock(dst_mm, dst_pmd, dst_addr, & ptl)
107  如果File we map to (can be NULL).
109  inode等于f_inode
110  offset等于linear_page_index(dst_vma, dst_addr)
111  max_off等于DIV_ROUND_UP(NOTE: in a 32bit arch with a preemptable kernel and* an UP compile the i_size_read/write must be atomic* with respect to the local cpu (unlike with preempt disabled),* but they don't need to be atomic with respect to other cpus like in* true SMP (so they , PAGE_SIZE)
112  ret等于负EFAULT
113  如果此条件成立可能性小(为编译器优化)(offset >= max_off)则转到:out_release_uncharge_unlock
116  ret等于负EEXIST
117  如果非pte_none( * dst_pte)则转到:out_release_uncharge_unlock
120  inc_mm_counter(dst_mm, MM_ANONPAGES)
121  page_add_new_anon_rmap - add pte mapping to a new anonymous page*@page: the page to add the mapping to*@vma: the vm area in which the mapping is added*@address: the user virtual address mapped*@compound: charge the page as compound or small page
122  mem_cgroup_commit_charge - commit a page charge*@page: page to charge*@memcg: memcg to charge the page to*@lrucare: page might be on LRU already*@compound: charge the page as compound or small page* Finalize a charge transaction started by
123  lru_cache_add_active_or_unevictable*@page: the page to be added to LRU*@vma: vma in which page is mapped for determining reclaimability* Place @page on the active or unevictable LRU list, depending on its* evictability
125  set_pte_at(dst_mm, dst_addr, dst_pte, _dst_pte)
128  The x86 doesn't have any external MMU info: the kernel page* tables contain all the necessary information.
130  pte_unmap_unlock(dst_pte, ptl)
131  ret等于0
132  out :
133  返回:ret
134  out_release_uncharge_unlock :
135  pte_unmap_unlock(dst_pte, ptl)
136  mem_cgroup_cancel_charge - cancel a page charge*@page: page to charge*@memcg: memcg to charge the page to*@compound: charge the page as compound or small page* Cancel a charge transaction started by mem_cgroup_try_charge().
137  out_release :
138  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
139  转到:out
调用者
名称描述
mfill_atomic_pte