Function report |
Source Code:mm\hugetlb.c |
Create Date:2022-07-28 15:29:12 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:Used by userfaultfd UFFDIO_COPY. Based on mcopy_atomic_pte with* modifications for huge pages.
Proto: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)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| 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 | If Not pagep Then |
| 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) |
| 4173 | Else |
| 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 | If vm_shared Then |
| 4194 | If idx >= size Then Go to out_release_nounlock |
| 4203 | ret = huge_add_to_page_cache(page, mapping, idx) |
| 4204 | If ret Then Go to out_release_nounlock |
| 4208 | ptl = huge_pte_lockptr(h, dst_mm, dst_pte) |
| 4222 | If idx >= size Then Go to out_release_unlock |
| 4226 | If Not huge_pte_none(huge_ptep_get(dst_pte)) Then Go to out_release_unlock |
| 4229 | If vm_shared Then |
| 4230 | page_dup_rmap(page, true) |
| 4231 | Else |
| 4236 | _dst_pte = make_huge_pte(dst_vma, page, Flags, see mm.h. & VM_WRITE) |
| 4237 | If Flags, see mm.h. & VM_WRITE Then _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 | spin_unlock(ptl) |
| 4254 | ret = 0 |
| 4255 | out : |
| 4256 | Return ret |
| 4257 | out_release_unlock : |
| 4258 | spin_unlock(ptl) |
| 4261 | out_release_nounlock : |
| 4263 | Go to out |
| Name | Describe |
|---|---|
| __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. |
| 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 |