Function report |
Source Code:mm\hugetlb.c |
Create Date:2022-07-28 15:28:19 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:copy_hugetlb_page_range
Proto:int copy_hugetlb_page_range(struct mm_struct *dst, struct mm_struct *src, struct vm_area_struct *vma)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct mm_struct * | dst | |
| struct mm_struct * | src | |
| struct vm_area_struct * | vma |
| 3307 | h = hstate_vma(vma) |
| 3308 | sz = huge_page_size(h) |
| 3310 | ret = 0 |
| 3312 | cow = (Flags, see mm.h. & (VM_SHARED | VM_MAYWRITE)) == VM_MAYWRITE |
| 3314 | If cow Then |
| 3315 | mmu_notifier_range_init( & range, MMU_NOTIFY_CLEAR, 0, vma, src, Our start address within vm_mm. , The first byte after our end addresswithin vm_mm. ) |
| 3318 | mmu_notifier_invalidate_range_start( & range) |
| 3323 | src_pte = huge_pte_offset(src, addr, sz) |
| 3324 | If Not src_pte Then Continue |
| 3326 | dst_pte = arch callbacks |
| 3327 | If Not dst_pte Then |
| 3341 | dst_entry = huge_ptep_get(dst_pte) |
| 3342 | If dst_pte == src_pte || Not huge_pte_none(dst_entry) Then Continue |
| 3345 | dst_ptl = huge_pte_lock(h, dst, dst_pte) |
| 3346 | src_ptl = huge_pte_lockptr(h, src, src_pte) |
| 3348 | entry = huge_ptep_get(src_pte) |
| 3349 | dst_entry = huge_ptep_get(dst_pte) |
| 3350 | If huge_pte_none(entry) || Not huge_pte_none(dst_entry) Then Else if Value for the false possibility is greater at compile time(is_hugetlb_entry_migration(entry) || is_hugetlb_entry_hwpoisoned(entry)) Then |
| 3359 | swp_entry = Convert the arch-dependent pte representation of a swp_entry_t into an* arch-independent swp_entry_t. |
| 3361 | If is_write_migration_entry(swp_entry) && cow Then |
| 3372 | Else |
| 3373 | If cow Then |
| 3381 | huge_ptep_set_wrprotect(src, addr, src_pte) |
| 3383 | entry = huge_ptep_get(src_pte) |
| 3386 | page_dup_rmap(ptepage, true) |
| 3387 | set_huge_pte_at(dst, addr, dst_pte, entry) |
| 3388 | hugetlb_count_add(pages_per_huge_page(h), dst) |
| 3390 | spin_unlock(src_ptl) |
| 3391 | spin_unlock(dst_ptl) |
| 3394 | If cow Then mmu_notifier_invalidate_range_end( & range) |
| 3397 | Return ret |
| 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 |