+ xsk-do-not-use-mmap_sem.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: net/xdp/xdp_umem.c: do not use mmap_sem
has been added to the -mm tree.  Its filename is
     xsk-do-not-use-mmap_sem.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/xsk-do-not-use-mmap_sem.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/xsk-do-not-use-mmap_sem.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Davidlohr Bueso <dave@xxxxxxxxxxxx>
Subject: net/xdp/xdp_umem.c: do not use mmap_sem

Holding mmap_sem exclusively for a gup() is an overkill.  Lets replace the
call for gup_fast() and let the mm take it if necessary.

Link: http://lkml.kernel.org/r/20190207053740.26915-2-dave@xxxxxxxxxxxx
Signed-off-by: Davidlohr Bueso <dbueso@xxxxxxx>
Cc: David S. Miller <davem@xxxxxxxxxxxxx>
Cc: Bjorn Topel <bjorn.topel@xxxxxxxxx>
Cc: Magnus Karlsson <magnus.karlsson@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---


--- a/net/xdp/xdp_umem.c~xsk-do-not-use-mmap_sem
+++ a/net/xdp/xdp_umem.c
@@ -265,10 +265,8 @@ static int xdp_umem_pin_pages(struct xdp
 	if (!umem->pgs)
 		return -ENOMEM;
 
-	down_write(&current->mm->mmap_sem);
-	npgs = get_user_pages(umem->address, umem->npgs,
-			      gup_flags, &umem->pgs[0], NULL);
-	up_write(&current->mm->mmap_sem);
+	npgs = get_user_pages_fast(umem->address, umem->npgs,
+				   gup_flags, &umem->pgs[0]);
 
 	if (npgs != umem->npgs) {
 		if (npgs >= 0) {
_

Patches currently in -mm which might be from dave@xxxxxxxxxxxx are

mm-make-mm-pinned_vm-an-atomic64-counter.patch
drivers-mic-scif-do-not-use-mmap_sem.patch
drivers-ibqib-optimize-mmap_sem-usage.patch
drivers-ibhfi1-do-not-se-mmap_sem.patch
drivers-ibusnic-reduce-scope-of-mmap_sem.patch
drivers-ibcore-reduce-scope-of-mmap_sem.patch
xsk-do-not-use-mmap_sem.patch
mips-c-r4k-do-no-use-mmap_sem-for-gup_fast.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux