函数逻辑报告 |
Source Code:mm\hugetlb.c |
Create Date:2022-07-27 17:00:49 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:hugetlb_no_page
函数原型:static vm_fault_t hugetlb_no_page(struct mm_struct *mm, struct vm_area_struct *vma, struct address_space *mapping, unsigned long idx, unsigned long address, pte_t *ptep, unsigned int flags)
返回类型:vm_fault_t
参数:
类型 | 参数 | 名称 |
---|---|---|
struct mm_struct * | mm | |
struct vm_area_struct * | vma | |
struct address_space * | mapping | |
unsigned long | idx | |
unsigned long | address | |
pte_t * | ptep | |
unsigned int | flags |
3793 | h等于hstate_vma(vma) |
3794 | ret等于VM_FAULT_SIGBUS |
3795 | anon_rmap等于0 |
3800 | haddr等于address按位与huge_page_mask(h) |
3801 | bool new_page = false |
3808 | 如果is_vma_resv_set(vma, HPAGE_RESV_UNMAPPED)则 |
3809 | pr_warn_ratelimited("PID %d killed due to inadequate hugepage pool\n", pid) |
3811 | 返回:ret |
3818 | retry : |
3820 | 如果非page则 |
3828 | 如果userfaultfd_missing(vma)则 |
3830 | struct vm_fault vmf = {Target VMA = vma, Faulting virtual address = haddr, FAULT_FLAG_xxx flags = flags, } |
3848 | hash等于For uniprocesor systems we always use a single mutex, so just* return 0 and avoid the hashing overhead. |
3850 | ret等于handle_userfault( & vmf, missing pages tracking ) |
3851 | mutex_lock( & hugetlb_fault_mutex_table[hash]) |
3852 | 转到:out |
3855 | page等于alloc_huge_page(vma, haddr, 0) |
3856 | 如果是错误则 |
3869 | ptl等于huge_pte_lock(h, mm, ptep) |
3870 | 如果非huge_pte_none(huge_ptep_get(ptep))则 |
3875 | 自旋锁解锁 |
3877 | 转到:out |
3879 | clear_huge_page(page, address, pages_per_huge_page(h)) |
3880 | __SetPageUptodate(page) |
3881 | new_page = true |
3883 | 如果Flags, see mm.h. 按位与VM_MAYSHARE则 |
3891 | 否则 |
3893 | 如果此条件成立可能性小(为编译器优化)(anon_vma_prepare(vma))则 |
3894 | ret等于VM_FAULT_OOM |
3895 | 转到:backout_unlocked |
3897 | anon_rmap等于1 |
3899 | 否则 |
3905 | 如果此条件成立可能性小(为编译器优化)(PageHWPoison(page))则 |
3908 | 转到:backout_unlocked |
3918 | 如果flags按位与Fault was a write access 且非Flags, see mm.h. 按位与VM_SHARED的值则 |
3919 | 如果vma_needs_reservation(h, vma, haddr)小于0则 |
3920 | ret等于VM_FAULT_OOM |
3921 | 转到:backout_unlocked |
3924 | vma_end_reservation(h, vma, haddr) |
3927 | ptl等于huge_pte_lock(h, mm, ptep) |
3932 | ret等于0 |
3933 | 如果非huge_pte_none(huge_ptep_get(ptep))则转到:backout |
3936 | 如果anon_rmap则 |
3938 | hugepage_add_new_anon_rmap(page, vma, haddr) |
3939 | 否则page_dup_rmap(page, true) |
3941 | new_pte等于make_huge_pte(vma, page, ((Flags, see mm.h. & VM_WRITE) && (Flags, see mm.h. & VM_SHARED))) |
3943 | set_huge_pte_at(mm, haddr, ptep, new_pte) |
3945 | hugetlb_count_add(pages_per_huge_page(h), mm) |
3946 | 如果flags按位与Fault was a write access 且非Flags, see mm.h. 按位与VM_SHARED的值则 |
3951 | 自旋锁解锁 |
3958 | 如果new_page则ver called for tail page |
3962 | out : |
3963 | 返回:ret |
3965 | backout : |
3966 | 自旋锁解锁 |
3967 | backout_unlocked : |
3971 | 转到:out |
名称 | 描述 |
---|---|
hugetlb_fault |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |