linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/7] get_user_pages() cleanup
@ 2015-10-06  9:24 Jan Kara
       [not found] ` <1444123470-4932-1-git-send-email-jack-IBi9RG/b67k@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kara @ 2015-10-06  9:24 UTC (permalink / raw)
  To: linux-mm
  Cc: Jan Kara, Jesper Nilsson, linux-cris-kernel, Mikael Starvik,
	linux-ia64, Tony Luck, David Airlie, dri-devel, Timur Tabi,
	linux-rdma, Roland Dreier, Daniel Vetter, Andy Walls, linux-media,
	Mauro Carvalho Chehab

From: Jan Kara <jack@suse.cz>

  Hello,

Now when the usage of get_user_pages() in media drivers got cleaned up, here
comes a series which removes knowledge about mmap_sem from a couple of other
drivers. Patches are trivial and standalone but please check, they are only
compile tested. If you are OK with them, either take them through your
respective trees or ack them and I can take care of pushing them to Linus
(probably through mm tree). Thanks.

After these patches there are some 12 call sites of get_user_pages() outside of
core code (mostly infiniband and RDMA). So we are slowly getting to the goal of
removing knowledge about page fault locking from drivers which will
consequently allow us to change the locking rules with reasonable effort.

								Honza

CC: Jesper Nilsson <jesper.nilsson@axis.com>
CC: linux-cris-kernel@axis.com
CC: Mikael Starvik <starvik@axis.com>
CC: linux-ia64@vger.kernel.org
CC: Tony Luck <tony.luck@intel.com>
CC: David Airlie <airlied@linux.ie>
CC: dri-devel@lists.freedesktop.org
CC: Timur Tabi <timur@freescale.com>
CC: linux-rdma@vger.kernel.org
CC: Roland Dreier <roland@kernel.org>
CC: Daniel Vetter <daniel.vetter@intel.com>
CC: David Airlie <airlied@linux.ie>
CC: dri-devel@lists.freedesktop.org
CC: Andy Walls <awalls@md.metrocast.net>
CC: linux-media@vger.kernel.org
CC: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 5/7] IB/mthca: Convert mthca_map_user_db() to use get_user_pages_fast()
       [not found] ` <1444123470-4932-1-git-send-email-jack-IBi9RG/b67k@public.gmane.org>
@ 2015-10-06  9:24   ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2015-10-06  9:24 UTC (permalink / raw)
  To: linux-mm-Bw31MaZKKs3YtjvyW6yDsg
  Cc: Jan Kara, Roland Dreier, linux-rdma-u79uwXL29TY76Z2rM5mHXA

From: Jan Kara <jack-AlSwsSmVLrQ@public.gmane.org>

Function mthca_map_user_db() appears to call get_user_pages() without
holding mmap_sem. Fix the bug by using get_user_pages_fast() instead
which also takes care of the locking.

CC: Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
CC: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Signed-off-by: Jan Kara <jack-AlSwsSmVLrQ@public.gmane.org>
---
 drivers/infiniband/hw/mthca/mthca_memfree.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/mthca/mthca_memfree.c b/drivers/infiniband/hw/mthca/mthca_memfree.c
index 7d2e42dd6926..c3543b27a2a7 100644
--- a/drivers/infiniband/hw/mthca/mthca_memfree.c
+++ b/drivers/infiniband/hw/mthca/mthca_memfree.c
@@ -472,8 +472,7 @@ int mthca_map_user_db(struct mthca_dev *dev, struct mthca_uar *uar,
 		goto out;
 	}
 
-	ret = get_user_pages(current, current->mm, uaddr & PAGE_MASK, 1, 1, 0,
-			     pages, NULL);
+	ret = get_user_pages_fast(uaddr & PAGE_MASK, 1, 1, pages);
 	if (ret < 0)
 		goto out;
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-10-06  9:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-06  9:24 [PATCH 0/7] get_user_pages() cleanup Jan Kara
     [not found] ` <1444123470-4932-1-git-send-email-jack-IBi9RG/b67k@public.gmane.org>
2015-10-06  9:24   ` [PATCH 5/7] IB/mthca: Convert mthca_map_user_db() to use get_user_pages_fast() Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).