'\" t .\" Title: get_user_pages_fast .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Memory Management in Linux .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "GET_USER_PAGES_FAST" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Memory Management in Linux" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" get_user_pages_fast \- pin user pages in memory .SH "SYNOPSIS" .HP \w'int\ get_user_pages_fast('u .BI "int get_user_pages_fast(unsigned\ long\ " "start" ", int\ " "nr_pages" ", int\ " "write" ", struct\ page\ **\ " "pages" ");" .SH "ARGUMENTS" .PP \fIstart\fR .RS 4 starting user address .RE .PP \fInr_pages\fR .RS 4 number of pages from start to pin .RE .PP \fIwrite\fR .RS 4 whether pages will be written to .RE .PP \fIpages\fR .RS 4 array that receives pointers to the pages pinned\&. Should be at least nr_pages long\&. .RE .SH "DESCRIPTION" .PP 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\&. .PP 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\&. .PP 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 \fBget_user_pages\fR) 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\&. .SH "COPYRIGHT" .br