Function report |
Source Code:mm\hugetlb.c |
Create Date:2022-07-28 15:28:38 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name: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.
Proto: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)
Type:vm_fault_t
Parameter:
Type | Parameter | Name |
---|---|---|
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 | If page_mapcount(old_page) == 1 && PageAnon(old_page) Then |
3628 | set_huge_ptep_writable(vma, haddr, ptep) |
3629 | Return 0 |
3651 | spin_unlock(ptl) |
3652 | new_page = alloc_huge_page(vma, haddr, outside_reserve) |
3662 | If outside_reserve Then |
3664 | BUG_ON(huge_pte_none(pte)) |
3666 | BUG_ON(huge_pte_none(pte)) |
3668 | ptep = huge_pte_offset(mm, haddr, huge_page_size(h)) |
3669 | If Value is more likely to compile time(ptep && pte_same(huge_ptep_get(ptep), pte)) Then Go to retry_avoidcopy |
3676 | Return 0 |
3680 | Go to out_release_old |
3688 | ret = VM_FAULT_OOM |
3689 | Go to 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) |
3705 | ptep = huge_pte_offset(mm, haddr, huge_page_size(h)) |
3706 | If Value is more likely to compile time(ptep && pte_same(huge_ptep_get(ptep), pte)) Then |
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 | spin_unlock(ptl) |
3721 | mmu_notifier_invalidate_range_end( & range) |
3722 | out_release_all : |
3725 | out_release_old : |
3729 | Return ret |
Name | Describe |
---|---|
hugetlb_no_page | |
hugetlb_fault |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |