From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH v2 07/18] infiniband: set FOLL_PIN, FOLL_LONGTERM via pin_longterm_pages*() Date: Mon, 4 Nov 2019 16:57:38 -0400 Message-ID: <20191104205738.GH30938@ziepe.ca> References: <20191103211813.213227-1-jhubbard@nvidia.com> <20191103211813.213227-8-jhubbard@nvidia.com> <20191104203346.GF30938@ziepe.ca> <578c1760-7221-4961-9f7d-c07c22e5c259@nvidia.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <578c1760-7221-4961-9f7d-c07c22e5c259@nvidia.com> Sender: linux-kernel-owner@vger.kernel.org To: John Hubbard Cc: Andrew Morton , Al Viro , Alex Williamson , Benjamin Herrenschmidt , =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= , Christoph Hellwig , Dan Williams , Daniel Vetter , Dave Chinner , David Airlie , "David S . Miller" , Ira Weiny , Jan Kara , Jens Axboe , Jonathan Corbet , =?utf-8?B?SsOpcsO0bWU=?= Glisse , Magnus Karlsson , Mauro Carvalho Chehab , Michael Ellerman List-Id: dri-devel@lists.freedesktop.org On Mon, Nov 04, 2019 at 12:48:13PM -0800, John Hubbard wrote: > On 11/4/19 12:33 PM, Jason Gunthorpe wrote: > ... > >> diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c > >> index 24244a2f68cc..c5a78d3e674b 100644 > >> +++ b/drivers/infiniband/core/umem.c > >> @@ -272,11 +272,10 @@ struct ib_umem *ib_umem_get(struct ib_udata *udata, unsigned long addr, > >> > >> while (npages) { > >> down_read(&mm->mmap_sem); > >> - ret = get_user_pages(cur_base, > >> + ret = pin_longterm_pages(cur_base, > >> min_t(unsigned long, npages, > >> PAGE_SIZE / sizeof (struct page *)), > >> - gup_flags | FOLL_LONGTERM, > >> - page_list, NULL); > >> + gup_flags, page_list, NULL); > > > > FWIW, this one should be converted to fast as well, I think we finally > > got rid of all the blockers for that? > > > > I'm not aware of any blockers on the gup.c end, anyway. The only broken thing we > have there is "gup remote + FOLL_LONGTERM". But we can do "gup fast + LONGTERM". I mean the use of the mmap_sem here is finally in a way where we can just delete the mmap_sem and use _fast ie, AFAIK there is no need for the mmap_sem to be held during ib_umem_add_sg_table() This should probably be a standalone patch however Jason