diff options
Diffstat (limited to 'mm/util.c')
| -rw-r--r-- | mm/util.c | 16 |
1 files changed, 12 insertions, 4 deletions
| @@ -233,13 +233,21 @@ void arch_pick_mmap_layout(struct mm_struct *mm) | |||
| 233 | * @pages: array that receives pointers to the pages pinned. | 233 | * @pages: array that receives pointers to the pages pinned. |
| 234 | * Should be at least nr_pages long. | 234 | * Should be at least nr_pages long. |
| 235 | * | 235 | * |
| 236 | * Attempt to pin user pages in memory without taking mm->mmap_sem. | ||
| 237 | * If not successful, it will fall back to taking the lock and | ||
| 238 | * calling get_user_pages(). | ||
| 239 | * | ||
| 240 | * Returns number of pages pinned. This may be fewer than the number | 236 | * Returns number of pages pinned. This may be fewer than the number |
| 241 | * requested. If nr_pages is 0 or negative, returns 0. If no pages | 237 | * requested. If nr_pages is 0 or negative, returns 0. If no pages |
| 242 | * were pinned, returns -errno. | 238 | * were pinned, returns -errno. |
| 239 | * | ||
| 240 | * get_user_pages_fast provides equivalent functionality to get_user_pages, | ||
| 241 | * operating on current and current->mm, with force=0 and vma=NULL. However | ||
| 242 | * unlike get_user_pages, it must be called without mmap_sem held. | ||
| 243 | * | ||
| 244 | * get_user_pages_fast may take mmap_sem and page table locks, so no | ||
| 245 | * assumptions can be made about lack of locking. get_user_pages_fast is to be | ||
| 246 | * implemented in a way that is advantageous (vs get_user_pages()) when the | ||
| 247 | * user memory area is already faulted in and present in ptes. However if the | ||
| 248 | * pages have to be faulted in, it may turn out to be slightly slower so | ||
| 249 | * callers need to carefully consider what to use. On many architectures, | ||
| 250 | * get_user_pages_fast simply falls back to get_user_pages. | ||
| 243 | */ | 251 | */ |
| 244 | int __attribute__((weak)) get_user_pages_fast(unsigned long start, | 252 | int __attribute__((weak)) get_user_pages_fast(unsigned long start, |
| 245 | int nr_pages, int write, struct page **pages) | 253 | int nr_pages, int write, struct page **pages) |
