Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:get_user_pages_fast() - pin user pages in memory*@start: starting user address*@nr_pages: number of pages from start to pin*@gup_flags: flags modifying pin behaviour*@pages: array that receives pointers to the pages pinned.

Proto:int get_user_pages_fast(unsigned long start, int nr_pages, unsigned int gup_flags, struct page **pages)

Type:int

Parameter:

TypeParameterName
unsigned longstart
intnr_pages
unsigned intgup_flags
struct page **pages
2416  nr = 0 , ret = 0
2418  If WARN_ON_ONCE(gup_flags & ~(check pte is writable | mapping lifetime is indefinite: see below | get_user_pages read/write w/o permission )) Then Return -EINVAL
2422  start = Architectures that support memory tagging (assigning tags to memory regions,* embedding these tags into addresses that point to these memory regions, and* checking that the memory and the pointer tags match on memory accesses)(start) & PAGE_MASK
2423  addr = start
2424  len = nr_pages << PAGE_SHIFT determines the page size
2425  end = start + len
2427  If end <= start Then Return 0
2429  If Value for the false possibility is greater at compile time(!access_ok - Checks if a user space pointer is valid*@addr: User space pointer to start of block to check*@size: Size of block to check* Context: User context only. This function may sleep if pagefaults are* enabled.((void__user * )start, len)) Then Return -EFAULT
2432  If IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_HAVE_FAST_GUP) && Check if it's allowed to use __get_user_pages_fast() for the range, or* we need to fall back to the slow version: Then
2434  local_irq_disable()
2435  gup_pgd_range(addr, end, gup_flags, pages, & nr)
2436  The local_irq_*() APIs are equal to the raw_local_irq*()* if !TRACE_IRQFLAGS.()
2437  ret = nr
2440  If nr < nr_pages Then
2442  start += nr << PAGE_SHIFT determines the page size
2443  pages += nr
2445  ret = __gup_longterm_unlocked(start, nr_pages - nr, gup_flags, pages)
2449  If nr > 0 Then
2450  If ret < 0 Then ret = nr
2452  Else ret += nr
2457  Return ret
Caller
NameDescribe
iov_iter_get_pages_alloc
get_futex_keyget_futex_key() - Get parameters which are the keys for a futex*@uaddr: virtual address of the futex*@fshared: 0 for a PROCESS_PRIVATE futex, 1 for PROCESS_SHARED*@key: address where result is stored
madvise_inject_errorError injection support for memory error handling.
__gup_benchmark_ioctl