Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\memory.c Create Date:2022-07-28 14:44:12
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:copy_huge_page_from_user

Proto:long copy_huge_page_from_user(struct page *dst_page, const void __user *usr_src, unsigned int pages_per_huge_page, bool allow_pagefault)

Type:long

Parameter:

TypeParameterName
struct page *dst_page
const void __user *usr_src
unsigned intpages_per_huge_page
boolallow_pagefault
4768  src = usr_src
4770  rc = 0
4771  ret_val = pages_per_huge_page * PAGE_SIZE
4773  When i < pages_per_huge_page cycle
4774  If allow_pagefault Then page_kaddr = kmap(dst_page + i)
4776  Else page_kaddr = kmap_atomic(dst_page + i)
4778  rc = copy_from_user(page_kaddr, (constvoid__user * )(src + i * PAGE_SIZE), PAGE_SIZE)
4781  If allow_pagefault Then kunmap(dst_page + i)
4783  Else Prevent people trying to call kunmap_atomic() as if it were kunmap()* kunmap_atomic() should get the return value of kmap_atomic, not the page.(page_kaddr)
4786  ret_val -= PAGE_SIZE - rc
4787  If rc Then Break
4790  cond_resched()
4792  Return ret_val
Caller
NameDescribe
hugetlb_mcopy_atomic_pteUsed by userfaultfd UFFDIO_COPY. Based on mcopy_atomic_pte with* modifications for huge pages.
__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.