Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3091564imj; Mon, 11 Feb 2019 13:47:07 -0800 (PST) X-Google-Smtp-Source: AHgI3IbJxwMn7ODfE1whwaExnTT8vPt7nqb71j7pOF4hh56RDD6atny4a2kLo3ZUnCvMFk+ImllR X-Received: by 2002:a62:5182:: with SMTP id f124mr399955pfb.238.1549921627408; Mon, 11 Feb 2019 13:47:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549921627; cv=none; d=google.com; s=arc-20160816; b=mC1KAFk5AOttZxNsFXsbEr2/RRvT1aMBrLmLa2u2glTCIcHppCg/aSOSeDZBXZqW0b c2h9i9kDIoqizSUED70DOC0y1yQXbTeZhrmN7tsKtfk0Y2CUMuS9UxSr3Ohx9GZhPKZg /cj1FIncOb+xIYePxyyaAXlIPYKBuf82kUOD+MUWoKb2mA0Czl5KiLT8npAdHv9Q2XQ9 KdYreG4RefHIRWz29Zdzl5P0m9jSAmM4RI2opQHLE/ECR3rhqhBlDCDGsYTLK2xn51ou Z1OLVTM2qroOQa2Fsade+TnH1cFzufFAGlifWR3RdANUNqZlvtE4wAOmPR3BFsUi8Slr gwEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=IHB5000f+0jGPG331KCY3dFcs5NUkfAb7Nc5FDYKduk=; b=yGVcVFzSKQL2M0oEYAhV3XBVNiGeHPiUoqYbctpxKOahsgSWTRZM81TA51/5VLhjUz OWcqoVgJCLnz+IVPCsbiMv8qlt7o4wUyKbRG/oGmCGACWkzD5JCozzjemfYEXy67H8iC rcyrbt+ZxyEX2m1Kr+yFT8k5CkdeyQMplaygWpwEsa59mbYcCDBDVLr+Jf/eqa38u19U kuyighwyngbhRx3GT/HiOq6WrDWnnaXBDdWZKU1mpqskaIQ2NxWOkxFho/+kjOJ19CIm Szd0KrktS1lmJl0GqAcrCVJhb8ZiibWefb2GDvawIK+rT4+a1/F+FHmtKsYy6ee/LU6i HPEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=USp2kFdW; 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 c4si8672641pfa.40.2019.02.11.13.46.51; Mon, 11 Feb 2019 13:47:07 -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; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=USp2kFdW; 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 S1727893AbfBKVpS (ORCPT + 99 others); Mon, 11 Feb 2019 16:45:18 -0500 Received: from mail-ot1-f67.google.com ([209.85.210.67]:41713 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727687AbfBKVpR (ORCPT ); Mon, 11 Feb 2019 16:45:17 -0500 Received: by mail-ot1-f67.google.com with SMTP id u16so786781otk.8 for ; Mon, 11 Feb 2019 13:45:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IHB5000f+0jGPG331KCY3dFcs5NUkfAb7Nc5FDYKduk=; b=USp2kFdWHkpFy9GUpyBwhgLeMsja1nZWVvt0FG3gUdhs9S1dJNB1ZiTyEPFgyPcdFX Wl5oewMW4P8WckqwWimQoo0GAybQSBEy7WlZ7aJEA4Dhn7zIjH2FiM4R/dESfLkUUdsQ 8Fe5WNe3Jl2SrrihXSB7zzanWb8Dp9KSPz1omUWX2xSFR7fSjcr4csAgGKG323I24qvi sdd8V+zILguEI78fmKmGVPJVL7gmqenNr4PxzofQnGieeHYwz7SaGysjTF2oPigbFNEL aVrDCvOcwaIZBID3VpRG70H+/1e0QvrAg5NjyJ7KjsKYPLGFSZ5I0rhDzjBwMOAUMntv UAZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IHB5000f+0jGPG331KCY3dFcs5NUkfAb7Nc5FDYKduk=; b=tqBiksJGUBFXvUOHaoKuUZqOWMxLaOvxnlKgLG2ABmSyaJ4+DO0mvi3TdGpF/VWYwP ZTAPFnaboLjaCxQl//JSrZO+dKENTB9t3qXpkXBykzYke2fw5KUDSfo7RLsgaQAjGrdB 57/cvJInolNJ/3qE4dXisqwtu8yZsykuVMWMLrAevImOotRH4UK/pc0/omdxD74svbiX SY/22IlT/sRxTSIkhlXp1dZPpMUeRNZZDtOCw13mApNWTOBvKE8D2uC4YRJXvTzf1i5A zrtxMc9VKfJSs3B/ekocEdAPD8znH6n9syUuoZJlgYlYLJZ2DII6mTsUER6WYP47leoQ c1jA== X-Gm-Message-State: AHQUAuZ+SagPtvOgRYzicJdspgkHF/Ho9nnNnIsTWmINyZ7KPAGlWrin 6Ml2/64uTgZl4wAPz5Gsb0fTjEFTkpH5z2oVXXm6OXkH X-Received: by 2002:a9d:6a50:: with SMTP id h16mr328208otn.95.1549921516543; Mon, 11 Feb 2019 13:45:16 -0800 (PST) MIME-Version: 1.0 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> In-Reply-To: From: Dan Williams Date: Mon, 11 Feb 2019 13:45:05 -0800 Message-ID: Subject: Re: [PATCH 2/3] mm/gup: Introduce get_user_pages_fast_longterm() To: John Hubbard Cc: Ira Weiny , Jason Gunthorpe , linux-rdma , Linux Kernel Mailing List , Linux MM , Daniel Borkmann , Davidlohr Bueso , Netdev , Mike Marciniszyn , Dennis Dalessandro , Doug Ledford , Andrew Morton , "Kirill A. Shutemov" Content-Type: text/plain; charset="UTF-8" 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 1:39 PM 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. > A problem I now see with the _longterm name is that it hides its true intent. It's really a "dax can't use page cache tricks to make it seem like this page is ok to access indefinitely, if the system needs this page back your pin would prevent the forward progress of the system state.". If the discussion results in a need to have an explicit file state (immutable or lease) then we'll continue to need a gup pin type distinction. If the discussion resolves to one of the silent options (fail truncate, lie about truncate) then FOLL_LONGTERM might be able to die at that point.