函数逻辑报告 |
Source Code:mm\hugetlb.c |
Create Date:2022-07-27 17:01:10 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:Used by userfaultfd UFFDIO_COPY. Based on mcopy_atomic_pte with* modifications for huge pages.
函数原型:int hugetlb_mcopy_atomic_pte(struct mm_struct *dst_mm, pte_t *dst_pte, struct vm_area_struct *dst_vma, unsigned long dst_addr, unsigned long src_addr, struct page **pagep)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct mm_struct * | dst_mm | |
pte_t * | dst_pte | |
struct vm_area_struct * | dst_vma | |
unsigned long | dst_addr | |
unsigned long | src_addr | |
struct page ** | pagep |
4149 | vm_shared等于Flags, see mm.h. 按位与VM_SHARED |
4150 | h等于hstate_vma(dst_vma) |
4156 | 如果非pagep则 |
4158 | page等于alloc_huge_page(dst_vma, dst_addr, 0) |
4162 | ret等于copy_huge_page_from_user(page, (constvoid__user * )src_addr, pages_per_huge_page(h), false) |
4167 | 如果此条件成立可能性小(为编译器优化)(ret)则 |
4173 | 否则 |
4183 | __SetPageUptodate(page) |
4186 | idx等于Convert the address within this vma to the page offset within* the mapping, in pagecache page units; huge pages here. |
4191 | 如果vm_shared则 |
4194 | 如果idx大于等于size则转到:out_release_nounlock |
4203 | ret等于huge_add_to_page_cache(page, mapping, idx) |
4204 | 如果ret则转到:out_release_nounlock |
4208 | ptl等于huge_pte_lockptr(h, dst_mm, dst_pte) |
4209 | 加自旋锁 |
4222 | 如果idx大于等于size则转到:out_release_unlock |
4226 | 如果非huge_pte_none(huge_ptep_get(dst_pte))则转到:out_release_unlock |
4229 | 如果vm_shared则 |
4230 | page_dup_rmap(page, true) |
4231 | 否则 |
4236 | _dst_pte等于make_huge_pte(dst_vma, page, Flags, see mm.h. & VM_WRITE) |
4237 | 如果Flags, see mm.h. 按位与VM_WRITE则_dst_pte等于huge_pte_mkdirty(_dst_pte) |
4239 | _dst_pte等于pte_mkyoung(_dst_pte) |
4241 | set_huge_pte_at(dst_mm, dst_addr, dst_pte, _dst_pte) |
4245 | hugetlb_count_add(pages_per_huge_page(h), dst_mm) |
4250 | 自旋锁解锁 |
4254 | ret等于0 |
4255 | out : |
4256 | 返回:ret |
4257 | out_release_unlock : |
4258 | 自旋锁解锁 |
4261 | out_release_nounlock : |
4263 | 转到:out |
名称 | 描述 |
---|---|
__mcopy_atomic_hugetlb | __mcopy_atomic processing for HUGETLB vmas. Note that this routine is* called with mmap_sem held, it will release mmap_sem before returning. |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |