Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'work.get_user_pages_fast' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull get_user_pages_fast() conversion from Al Viro:
"A bunch of places switched to get_user_pages_fast()"

* 'work.get_user_pages_fast' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
ceph: use get_user_pages_fast()
pvr2fs: use get_user_pages_fast()
atomisp: use get_user_pages_fast()
st: use get_user_pages_fast()
via_dmablit(): use get_user_pages_fast()
fsl_hypervisor: switch to get_user_pages_fast()
rapidio: switch to get_user_pages_fast()
vchiq_2835_arm: switch to get_user_pages_fast()

+20 -36
+3 -3
drivers/gpu/drm/via/via_dmablit.c
··· 238 238 vsg->pages = vzalloc(sizeof(struct page *) * vsg->num_pages); 239 239 if (NULL == vsg->pages) 240 240 return -ENOMEM; 241 - ret = get_user_pages_unlocked((unsigned long)xfer->mem_addr, 242 - vsg->num_pages, vsg->pages, 243 - (vsg->direction == DMA_FROM_DEVICE) ? FOLL_WRITE : 0); 241 + ret = get_user_pages_fast((unsigned long)xfer->mem_addr, 242 + vsg->num_pages, vsg->direction == DMA_FROM_DEVICE, 243 + vsg->pages); 244 244 if (ret != vsg->num_pages) { 245 245 if (ret < 0) 246 246 return ret;
+2 -4
drivers/rapidio/devices/rio_mport_cdev.c
··· 889 889 goto err_req; 890 890 } 891 891 892 - pinned = get_user_pages_unlocked( 892 + pinned = get_user_pages_fast( 893 893 (unsigned long)xfer->loc_addr & PAGE_MASK, 894 - nr_pages, 895 - page_list, 896 - dir == DMA_FROM_DEVICE ? FOLL_WRITE : 0); 894 + nr_pages, dir == DMA_FROM_DEVICE, page_list); 897 895 898 896 if (pinned != nr_pages) { 899 897 if (pinned < 0) {
+1 -5
drivers/scsi/st.c
··· 4920 4920 4921 4921 /* Try to fault in all of the necessary pages */ 4922 4922 /* rw==READ means read from drive, write into memory area */ 4923 - res = get_user_pages_unlocked( 4924 - uaddr, 4925 - nr_pages, 4926 - pages, 4927 - rw == READ ? FOLL_WRITE : 0); /* don't force */ 4923 + res = get_user_pages_fast(uaddr, nr_pages, rw == READ, pages); 4928 4924 4929 4925 /* Errors and no page mapped should return here */ 4930 4926 if (res < nr_pages)
+2 -4
drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c
··· 1020 1020 } else { 1021 1021 /*Handle frame buffer allocated in user space*/ 1022 1022 mutex_unlock(&bo->mutex); 1023 - down_read(&current->mm->mmap_sem); 1024 - page_nr = get_user_pages((unsigned long)userptr, 1025 - (int)(bo->pgnr), 1, pages, NULL); 1026 - up_read(&current->mm->mmap_sem); 1023 + page_nr = get_user_pages_fast((unsigned long)userptr, 1024 + (int)(bo->pgnr), 1, pages); 1027 1025 mutex_lock(&bo->mutex); 1028 1026 bo->mem_type = HMM_BO_MEM_TYPE_USER; 1029 1027 }
+7 -13
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c
··· 90 90 vchiq_doorbell_irq(int irq, void *dev_id); 91 91 92 92 static struct vchiq_pagelist_info * 93 - create_pagelist(char __user *buf, size_t count, unsigned short type, 94 - struct task_struct *task); 93 + create_pagelist(char __user *buf, size_t count, unsigned short type); 95 94 96 95 static void 97 96 free_pagelist(struct vchiq_pagelist_info *pagelistinfo, ··· 254 255 pagelistinfo = create_pagelist((char __user *)offset, size, 255 256 (dir == VCHIQ_BULK_RECEIVE) 256 257 ? PAGELIST_READ 257 - : PAGELIST_WRITE, 258 - current); 258 + : PAGELIST_WRITE); 259 259 260 260 if (!pagelistinfo) 261 261 return VCHIQ_ERROR; ··· 393 395 */ 394 396 395 397 static struct vchiq_pagelist_info * 396 - create_pagelist(char __user *buf, size_t count, unsigned short type, 397 - struct task_struct *task) 398 + create_pagelist(char __user *buf, size_t count, unsigned short type) 398 399 { 399 400 PAGELIST_T *pagelist; 400 401 struct vchiq_pagelist_info *pagelistinfo; ··· 473 476 } 474 477 /* do not try and release vmalloc pages */ 475 478 } else { 476 - down_read(&task->mm->mmap_sem); 477 - actual_pages = get_user_pages( 478 - (unsigned long)buf & PAGE_MASK, 479 + actual_pages = get_user_pages_fast( 480 + (unsigned long)buf & PAGE_MASK, 479 481 num_pages, 480 - (type == PAGELIST_READ) ? FOLL_WRITE : 0, 481 - pages, 482 - NULL /*vmas */); 483 - up_read(&task->mm->mmap_sem); 482 + type == PAGELIST_READ, 483 + pages); 484 484 485 485 if (actual_pages != num_pages) { 486 486 vchiq_log_info(vchiq_arm_log_level,
+1 -3
drivers/video/fbdev/pvr2fb.c
··· 686 686 if (!pages) 687 687 return -ENOMEM; 688 688 689 - ret = get_user_pages_unlocked((unsigned long)buf, nr_pages, pages, 690 - FOLL_WRITE); 691 - 689 + ret = get_user_pages_fast((unsigned long)buf, nr_pages, true, pages); 692 690 if (ret < nr_pages) { 693 691 nr_pages = ret; 694 692 ret = -EINVAL;
+2 -2
drivers/virt/fsl_hypervisor.c
··· 243 243 sg_list = PTR_ALIGN(sg_list_unaligned, sizeof(struct fh_sg_list)); 244 244 245 245 /* Get the physical addresses of the source buffer */ 246 - num_pinned = get_user_pages_unlocked(param.local_vaddr - lb_offset, 247 - num_pages, pages, (param.source == -1) ? 0 : FOLL_WRITE); 246 + num_pinned = get_user_pages_fast(param.local_vaddr - lb_offset, 247 + num_pages, param.source != -1, pages); 248 248 249 249 if (num_pinned != num_pages) { 250 250 /* get_user_pages() failed */
+2 -2
net/ceph/pagevec.c
··· 25 25 return ERR_PTR(-ENOMEM); 26 26 27 27 while (got < num_pages) { 28 - rc = get_user_pages_unlocked( 28 + rc = get_user_pages_fast( 29 29 (unsigned long)data + ((unsigned long)got * PAGE_SIZE), 30 - num_pages - got, pages + got, write_page ? FOLL_WRITE : 0); 30 + num_pages - got, write_page, pages + got); 31 31 if (rc < 0) 32 32 break; 33 33 BUG_ON(rc == 0);