From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Hubbard Subject: [PATCH v2 11/18] net/xdp: set FOLL_PIN via pin_user_pages() Date: Sun, 3 Nov 2019 13:18:06 -0800 Message-ID: <20191103211813.213227-12-jhubbard@nvidia.com> References: <20191103211813.213227-1-jhubbard@nvidia.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20191103211813.213227-1-jhubbard@nvidia.com> Sender: netdev-owner@vger.kernel.org To: Andrew Morton Cc: Al Viro , Alex Williamson , Benjamin Herrenschmidt , =?UTF-8?q?Bj=C3=B6rn=20T=C3=B6pel?= , Christoph Hellwig , Dan Williams , Daniel Vetter , Dave Chinner , David Airlie , "David S . Miller" , Ira Weiny , Jan Kara , Jason Gunthorpe , Jens Axboe , Jonathan Corbet , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Magnus Karlsson , Mauro Carvalho Chehab , Michael Ellerman List-Id: dri-devel@lists.freedesktop.org Convert net/xdp to use the new pin_longterm_pages() call, which sets FOLL_PIN. Setting FOLL_PIN is now required for code that requires tracking of pinned pages. Reviewed-by: Ira Weiny Acked-by: Bj=C3=B6rn T=C3=B6pel Signed-off-by: John Hubbard --- net/xdp/xdp_umem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c index 3049af269fbf..66c814863cfd 100644 --- a/net/xdp/xdp_umem.c +++ b/net/xdp/xdp_umem.c @@ -291,8 +291,8 @@ static int xdp_umem_pin_pages(struct xdp_umem *umem) return -ENOMEM; =20 down_read(¤t->mm->mmap_sem); - npgs =3D get_user_pages(umem->address, umem->npgs, - gup_flags | FOLL_LONGTERM, &umem->pgs[0], NULL); + npgs =3D pin_longterm_pages(umem->address, umem->npgs, gup_flags, + &umem->pgs[0], NULL); up_read(¤t->mm->mmap_sem); =20 if (npgs !=3D umem->npgs) { --=20 2.23.0