From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09A8EFC6196 for ; Thu, 7 Nov 2019 02:26:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B36422067B for ; Thu, 7 Nov 2019 02:26:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B36422067B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2E6196B0003; Wed, 6 Nov 2019 21:26:52 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 26ED46B0006; Wed, 6 Nov 2019 21:26:52 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 10FB06B0007; Wed, 6 Nov 2019 21:26:52 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0229.hostedemail.com [216.40.44.229]) by kanga.kvack.org (Postfix) with ESMTP id EAD556B0003 for ; Wed, 6 Nov 2019 21:26:51 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id A40A2127F for ; Thu, 7 Nov 2019 02:26:51 +0000 (UTC) X-FDA: 76127893422.10.rate20_58d687b528f2f X-HE-Tag: rate20_58d687b528f2f X-Filterd-Recvd-Size: 4217 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by imf43.hostedemail.com (Postfix) with ESMTP for ; Thu, 7 Nov 2019 02:26:50 +0000 (UTC) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Nov 2019 18:26:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,276,1569308400"; d="scan'208";a="227685256" Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by fmsmga004.fm.intel.com with ESMTP; 06 Nov 2019 18:26:48 -0800 Date: Wed, 6 Nov 2019 18:26:48 -0800 From: Ira Weiny To: Jason Gunthorpe Cc: John Hubbard , Andrew Morton , Al Viro , Alex Williamson , Benjamin Herrenschmidt , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Christoph Hellwig , Dan Williams , Daniel Vetter , Dave Chinner , David Airlie , "David S . Miller" , Jan Kara , Jens Axboe , Jonathan Corbet , =?iso-8859-1?B?Suly9G1l?= Glisse , Magnus Karlsson , Mauro Carvalho Chehab , Michael Ellerman , Michal Hocko , Mike Kravetz , Paul Mackerras , Shuah Khan , Vlastimil Babka , bpf@vger.kernel.org, dri-devel@lists.freedesktop.org, kvm@vger.kernel.org, linux-block@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-media@vger.kernel.org, linux-rdma@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, netdev@vger.kernel.org, linux-mm@kvack.org, LKML Subject: Re: [PATCH v2 07/18] infiniband: set FOLL_PIN, FOLL_LONGTERM via pin_longterm_pages*() Message-ID: <20191107022647.GC32084@iweiny-DESK2.sc.intel.com> References: <20191103211813.213227-1-jhubbard@nvidia.com> <20191103211813.213227-8-jhubbard@nvidia.com> <20191104203346.GF30938@ziepe.ca> <578c1760-7221-4961-9f7d-c07c22e5c259@nvidia.com> <20191104205738.GH30938@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191104205738.GH30938@ziepe.ca> User-Agent: Mutt/1.11.1 (2018-12-01) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Nov 04, 2019 at 04:57:38PM -0400, Jason Gunthorpe wrote: > 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 Yay! I agree if we can do this we should. Thanks, Ira > > 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