Function report |
Source Code:mm\userfaultfd.c |
Create Date:2022-07-28 16:33:53 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:__mcopy_atomic processing for HUGETLB vmas. Note that this routine is* called with mmap_sem held, it will release mmap_sem before returning.
Proto:static __always_inline ssize_t __mcopy_atomic_hugetlb(struct mm_struct *dst_mm, struct vm_area_struct *dst_vma, unsigned long dst_start, unsigned long src_start, unsigned long len, bool zeropage)
Type:ssize_t
Parameter:
Type | Parameter | Name |
---|---|---|
struct mm_struct * | dst_mm | |
struct vm_area_struct * | dst_vma | |
unsigned long | dst_start | |
unsigned long | src_start | |
unsigned long | len | |
bool | zeropage |
210 | vm_alloc_shared = Flags, see mm.h. & VM_SHARED |
211 | vm_shared = Flags, see mm.h. & VM_SHARED |
228 | If zeropage Then |
230 | Return -EINVAL |
235 | copied = 0 |
236 | page = NULL |
237 | vma_hpagesize = Return the size of the pages allocated when backing a VMA. In the majority* cases this will be same size as used by the page table entries. |
243 | If dst_start & vma_hpagesize - 1 || len & vma_hpagesize - 1 Then Go to out_unlock |
246 | retry : |
251 | If Not dst_vma Then |
253 | dst_vma = find_dst_vma(dst_mm, dst_start, len) |
254 | If Not dst_vma || Not is_vm_hugetlb_page(dst_vma) Then Go to out_unlock |
258 | If vma_hpagesize != Return the size of the pages allocated when backing a VMA. In the majority* cases this will be same size as used by the page table entries. Then Go to out_unlock |
261 | vm_shared = Flags, see mm.h. & VM_SHARED |
268 | If Not vm_shared Then |
269 | If Value for the false possibility is greater at compile time(anon_vma_prepare(dst_vma)) Then Go to out_unlock |
281 | idx = linear_page_index(dst_vma, dst_addr) |
283 | hash = For uniprocesor systems we always use a single mutex, so just* return 0 and avoid the hashing overhead. |
284 | mutex_lock( & hugetlb_fault_mutex_table[hash]) |
287 | dst_pte = arch callbacks |
288 | If Not dst_pte Then |
290 | Go to out_unlock |
294 | dst_pteval = huge_ptep_get(dst_pte) |
295 | If Not huge_pte_none(dst_pteval) Then |
297 | Go to out_unlock |
300 | err = Used by userfaultfd UFFDIO_COPY. Based on mcopy_atomic_pte with* modifications for huge pages. |
304 | vm_alloc_shared = vm_shared |
306 | cond_resched() |
308 | If Value for the false possibility is greater at compile time(err == - ENOENT) Then |
312 | err = copy_huge_page_from_user(page, (constvoid__user * )src_addr, vma_hpagesize / PAGE_SIZE, true) |
320 | lock for reading |
322 | dst_vma = NULL |
323 | Go to retry |
327 | If Not err Then |
328 | dst_addr += vma_hpagesize |
329 | src_addr += vma_hpagesize |
330 | copied += vma_hpagesize |
332 | If fatal_signal_pending(current process) Then err = -EINTR |
335 | If err Then Break |
339 | out_unlock : |
341 | out : |
342 | If page Then |
Name | Describe |
---|---|
__mcopy_atomic |
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 |