---
name: "get_user_pages_fast"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/get_user_pages_fast"
---

# get\_user\_pages\_fast(9)

pin user pages in memory

## NAME

get\_user\_pages\_fast - pin user pages in memory

## SYNOPSIS

**int get\_user\_pages\_fast(unsigned long** *start***, int** *nr\_pages***, int** *write***, struct page \*\*** *pages***);**

## ARGUMENTS

*start*

starting user address

*nr\_pages*

number of pages from start to pin

*write*

whether pages will be written to

*pages*

array that receives pointers to the pages pinned. Should be at least nr\_pages long.

## DESCRIPTION

Returns number of pages pinned. This may be fewer than the number requested. If nr\_pages is 0 or negative, returns 0. If no pages were pinned, returns -errno.

get\_user\_pages\_fast provides equivalent functionality to get\_user\_pages, operating on current and current-\>mm, with force=0 and vma=NULL. However unlike get\_user\_pages, it must be called without mmap\_sem held.

get\_user\_pages\_fast may take mmap\_sem and page table locks, so no assumptions can be made about lack of locking. get\_user\_pages\_fast is to be implemented in a way that is advantageous (vs **get\_user\_pages**) when the user memory area is already faulted in and present in ptes. However if the pages have to be faulted in, it may turn out to be slightly slower so callers need to carefully consider what to use. On many architectures, get\_user\_pages\_fast simply falls back to get\_user\_pages.

## COPYRIGHT
