Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3096766imj; Mon, 11 Feb 2019 13:53:55 -0800 (PST) X-Google-Smtp-Source: AHgI3IYDbvPzjDVdBACzHEiAc54Zc1CuZt6Hzitk2zPuYqiX7bSW6Hlfb1NyVebVJQQnezPZ9be4 X-Received: by 2002:a63:da18:: with SMTP id c24mr387702pgh.318.1549922035598; Mon, 11 Feb 2019 13:53:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549922035; cv=none; d=google.com; s=arc-20160816; b=e+bmHG02bKrs6hJ0UzOkd71dRZeWFk9MovITj2syibx5FTxRd2ouSDE00lBEeWYcJD pZXcPGo18SoGiRXU5D9j8DJzIDtohpGe41KW4BhDH1knGrSWjU1bUF8IPJtBDE0oJMls jE482eNmTrdk4Hn01mJO7/ufempyXyhVUJF45rQdVW2HKXk5aKtgv5AvMtK/6Dftndul MXkdE+KTxyh1dwbW2kDrHHSpJ7brKJCaT2gF6eFgD/iSK4Zg0dhrFsW4l1CQokNavims /dl00ol7inzBw28pqybntKR0PAk3BgGOhsw/PiVxGY/yU9MxW55OdT2ylBjcQryGhzVh VJzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=DfwhzluMiJRkhh6w2zMSxGd5hXl4FLNYOUk9Jd94V7Y=; b=CviVGIGZvayH69GSFbKe4esL0OGX2qao79YKW5+8qGOTy9gcE+CPPBhbUosTi2Q91Z nmnjfqE8x/tuohRZRUppWBd9vHdo6WSdQNMu1huq6smlnE/qDumfQtzwu/PoxTtAk79D o5Z0SJ2xh5IRs5g9uqgzckFsTVRTVQw4CilDKVvEKzr27UCPjlCsxNv9ikMDrIymJmXO yNzt777uw60bbpmQ9qMVQ2hOLnPCYl037SSre/N7nlGKndVmiQ/aO09ut+d047hleSmC R5gtLmREj2ZjoqfInM2w1TmxfwFxUgt8CnAUrNtWJMGK6LoT0aXilrdZjTRWmXqeLoc4 oRow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si11505949pls.408.2019.02.11.13.53.38; Mon, 11 Feb 2019 13:53:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728011AbfBKVwu (ORCPT + 99 others); Mon, 11 Feb 2019 16:52:50 -0500 Received: from mga06.intel.com ([134.134.136.31]:58967 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726074AbfBKVwu (ORCPT ); Mon, 11 Feb 2019 16:52:50 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Feb 2019 13:52:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,360,1544515200"; d="scan'208";a="318156768" Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by fmsmga006.fm.intel.com with ESMTP; 11 Feb 2019 13:52:49 -0800 Date: Mon, 11 Feb 2019 13:52:38 -0800 From: Ira Weiny To: John Hubbard Cc: Jason Gunthorpe , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Daniel Borkmann , Davidlohr Bueso , netdev@vger.kernel.org, Mike Marciniszyn , Dennis Dalessandro , Doug Ledford , Andrew Morton , "Kirill A. Shutemov" , Dan Williams Subject: Re: [PATCH 2/3] mm/gup: Introduce get_user_pages_fast_longterm() Message-ID: <20190211215238.GA23825@iweiny-DESK2.sc.intel.com> References: <20190211201643.7599-1-ira.weiny@intel.com> <20190211201643.7599-3-ira.weiny@intel.com> <20190211203916.GA2771@ziepe.ca> <20190211212652.GA7790@iweiny-DESK2.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 11, 2019 at 01:39:12PM -0800, John Hubbard wrote: > On 2/11/19 1:26 PM, Ira Weiny wrote: > > On Mon, Feb 11, 2019 at 01:13:56PM -0800, John Hubbard wrote: > >> On 2/11/19 12:39 PM, Jason Gunthorpe wrote: > >>> On Mon, Feb 11, 2019 at 12:16:42PM -0800, ira.weiny@intel.com wrote: > >>>> From: Ira Weiny > >> [...] > >> It seems to me that the longterm vs. short-term is of questionable value. > > > > This is exactly why I did not post this before. I've been waiting our other > > discussions on how GUP pins are going to be handled to play out. But with the > > netdev thread today[1] it seems like we need to make sure we have a "safe" fast > > variant for a while. Introducing FOLL_LONGTERM seemed like the cleanest way to > > do that even if we will not need the distinction in the future... :-( > > Yes, I agree. Below... > > > [...] > > This is also why I did not change the get_user_pages_longterm because we could > > be ripping this all out by the end of the year... (I hope. :-) > > > > So while this does "pollute" the GUP family of calls I'm hoping it is not > > forever. > > > > Ira > > > > [1] https://lkml.org/lkml/2019/2/11/1789 > > > > Yes, and to be clear, I think your patchset here is fine. It is easy to find > the FOLL_LONGTERM callers if and when we want to change anything. I just think > also it's appopriate to go a bit further, and use FOLL_LONGTERM all by itself. > > That's because in either design outcome, it's better that way: > > -- If we keep the concept of "I'm a long-term gup call site", then FOLL_LONGTERM > is just right. The gup API already has _fast and non-fast variants, and once > you get past a couple, you end up with a multiplication of names that really > work better as flags. We're there. > > -- If we drop the concept, then you've already done part of the work, by removing > the _longterm API variants. Fair enough. But to do that correctly I think we will need to convert get_user_pages_fast() to use flags as well. I have a version of this series which includes a patch does this, but the patch touched a lot of subsystems and a couple of different architectures...[1] I can't test them all. If we want to go that way I'm up for submitting the patch... But if we remove longterm in the future we may be left with a get_user_pages_fast() which really only needs 1 flag. But perhaps overall we would be better off? Ira [1] mm/gup.c: Change GUP fast to use flags rather than write bool To facilitate additional options to get_user_pages_fast change the singular write parameter to be the more generic gup_flags. This patch currently does not change any functionality. New functionality will follow in subsequent patches. Many of the get_user_pages_fast call sites were unchanged because they already used FOLL_WRITE or 0 as appropriate. Signed-off-by: Ira Weiny --- arch/mips/mm/gup.c | 11 ++++++----- arch/powerpc/kvm/book3s_64_mmu_hv.c | 4 ++-- arch/powerpc/kvm/e500_mmu.c | 2 +- arch/powerpc/mm/mmu_context_iommu.c | 4 ++-- arch/s390/kvm/interrupt.c | 2 +- arch/s390/mm/gup.c | 12 ++++++------ arch/sh/mm/gup.c | 11 ++++++----- arch/sparc/mm/gup.c | 9 +++++---- arch/x86/kvm/paging_tmpl.h | 2 +- arch/x86/kvm/svm.c | 2 +- drivers/fpga/dfl-afu-dma-region.c | 2 +- drivers/gpu/drm/via/via_dmablit.c | 3 ++- drivers/infiniband/hw/hfi1/user_pages.c | 3 ++- drivers/misc/genwqe/card_utils.c | 2 +- drivers/misc/vmw_vmci/vmci_host.c | 2 +- drivers/misc/vmw_vmci/vmci_queue_pair.c | 6 ++++-- drivers/platform/goldfish/goldfish_pipe.c | 3 ++- drivers/rapidio/devices/rio_mport_cdev.c | 4 +++- drivers/sbus/char/oradax.c | 2 +- drivers/scsi/st.c | 3 ++- drivers/staging/gasket/gasket_page_table.c | 4 ++-- drivers/tee/tee_shm.c | 2 +- drivers/vfio/vfio_iommu_spapr_tce.c | 3 ++- drivers/vhost/vhost.c | 2 +- drivers/video/fbdev/pvr2fb.c | 2 +- drivers/virt/fsl_hypervisor.c | 2 +- drivers/xen/gntdev.c | 2 +- fs/orangefs/orangefs-bufmap.c | 2 +- include/linux/mm.h | 4 ++-- kernel/futex.c | 2 +- lib/iov_iter.c | 7 +++++-- mm/gup.c | 10 +++++----- mm/util.c | 8 ++++---- net/ceph/pagevec.c | 2 +- net/rds/info.c | 2 +- net/rds/rdma.c | 3 ++- 36 files changed, 81 insertions(+), 65 deletions(-)