函数逻辑报告 |
Source Code:mm\hugetlb.c |
Create Date:2022-07-27 17:00:32 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:Hugetlb_cow() should be called with page lock of the original hugepage held.* Called with hugetlb_instantiation_mutex held and pte_page locked so we* cannot race with other handlers or page migration.
函数原型:static vm_fault_t hugetlb_cow(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, pte_t *ptep, struct page *pagecache_page, spinlock_t *ptl)
返回类型:vm_fault_t
参数:
类型 | 参数 | 名称 |
---|---|---|
struct mm_struct * | mm | |
struct vm_area_struct * | vma | |
unsigned long | address | |
pte_t * | ptep | |
struct page * | pagecache_page | |
spinlock_t * | ptl |
3613 | h等于hstate_vma(vma) |
3615 | outside_reserve等于0 |
3616 | ret等于0 |
3617 | haddr等于address按位与huge_page_mask(h) |
3620 | pte等于huge_ptep_get(ptep) |
3623 | retry_avoidcopy : |
3626 | 如果page_mapcount(old_page)恒等于1且PageAnon(old_page)则 |
3628 | set_huge_ptep_writable(vma, haddr, ptep) |
3629 | 返回:0 |
3651 | 自旋锁解锁 |
3652 | new_page等于alloc_huge_page(vma, haddr, outside_reserve) |
3654 | 如果是错误则 |
3662 | 如果outside_reserve则 |
3664 | BUG_ON(huge_pte_none(pte)) |
3666 | BUG_ON(huge_pte_none(pte)) |
3667 | 加自旋锁 |
3668 | ptep等于huge_pte_offset(mm, haddr, huge_page_size(h)) |
3669 | 如果此条件成立可能性大(为编译器优化)(ptep && pte_same(huge_ptep_get(ptep), pte))则转到:retry_avoidcopy |
3676 | 返回:0 |
3680 | 转到:out_release_old |
3687 | 如果此条件成立可能性小(为编译器优化)(anon_vma_prepare(vma))则 |
3688 | ret等于VM_FAULT_OOM |
3689 | 转到:out_release_all |
3692 | copy_user_huge_page(new_page, old_page, address, vma, pages_per_huge_page(h)) |
3694 | __SetPageUptodate(new_page) |
3696 | mmu_notifier_range_init( & range, MMU_NOTIFY_CLEAR, 0, vma, mm, haddr, haddr + huge_page_size(h)) |
3698 | mmu_notifier_invalidate_range_start( & range) |
3704 | 加自旋锁 |
3705 | ptep等于huge_pte_offset(mm, haddr, huge_page_size(h)) |
3706 | 如果此条件成立可能性大(为编译器优化)(ptep && pte_same(huge_ptep_get(ptep), pte))则 |
3710 | huge_ptep_clear_flush(vma, haddr, ptep) |
3711 | mmu_notifier_invalidate_range(mm, start, end) |
3712 | set_huge_pte_at(mm, haddr, ptep, make_huge_pte(vma, new_page, 1)) |
3715 | hugepage_add_new_anon_rmap(new_page, vma, haddr) |
3720 | 自旋锁解锁 |
3721 | mmu_notifier_invalidate_range_end( & range) |
3722 | out_release_all : |
3725 | out_release_old : |
3728 | 加自旋锁 |
3729 | 返回:ret |
名称 | 描述 |
---|---|
hugetlb_no_page | |
hugetlb_fault |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |