Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3108584imj; Mon, 11 Feb 2019 14:07:50 -0800 (PST) X-Google-Smtp-Source: AHgI3IZwmbKT6l+HbVfjephHrWxkQ5SVNsTMP6tlZV7fzXRMpWUCQGt/dyNdkn7EEvkcB1kQPCyb X-Received: by 2002:a63:4665:: with SMTP id v37mr406997pgk.425.1549922870765; Mon, 11 Feb 2019 14:07:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549922870; cv=none; d=google.com; s=arc-20160816; b=ohlg8/8xS+9bDXKcqEwxt4n4e/cFo8vDjivHGYp2JtgJgYFIgyB6dJmmYBYCSVnp6d qI4q05r8F/6O172O2mfVJWwxFywHXxenH0WhZq6turGX52qKCZInpW4WUc/yVZ3O/XMe 9bk/WmJVZpnAeq1kivtthjLJFzM/PemobUfCppLURYA9gGK32kFYAJCYBGpP+40RD85w XtJf4tD8Owvhwdvm7Gpa/rZIvyLD5aGZIRorlJLacs9TZzRc0W1w/cV5EDxItZ8NOldI VBT6y8t9fmP6cWYxZ2A3c83fSv1OtOfVy0HToCugdSUaUH+F6Gg+SP5ife2g9Ks2QliW Ffbw== 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:dkim-signature; bh=frvaZOEeTzFuUHcq938YEPXksp5CEcnni8x382y8wmo=; b=eAIkknnEEVd/J84rVuggpVQhI/jcd3p2aw7A1NdQe8Uy3VwpSL1xOa7lYccXNRl5Nh YIJd6HNd0rjrx0iUr99r001Svo4YzzAXvmXulyy0estOgcB7Eddih7IrGeWR4hjj6uhv +9RavQ67jrM1KUzPTPmSbgM6LkNul4GdXrtt6DEpYJFAt6QmEPHkVauLuaJ9ENM7mXSz sBNXIdYKiJsQwIFgWHeDRZeR+xsqhrsyd/BpObaA9Bed+b1A4Rr13FKqbbHv/JgCO1CX olcXq1+Ck++Ggtq1W2b2hWLHtWLc2WVsXorX7FBzdi8BzEiwRx3gYWUjErG5gEz5Pzqc Sbww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=VeVuItjI; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q7si10665411pll.404.2019.02.11.14.07.34; Mon, 11 Feb 2019 14:07:50 -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=@ziepe.ca header.s=google header.b=VeVuItjI; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726969AbfBKWHB (ORCPT + 99 others); Mon, 11 Feb 2019 17:07:01 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:42985 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726337AbfBKWHB (ORCPT ); Mon, 11 Feb 2019 17:07:01 -0500 Received: by mail-pf1-f195.google.com with SMTP id n74so205869pfi.9 for ; Mon, 11 Feb 2019 14:07:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=frvaZOEeTzFuUHcq938YEPXksp5CEcnni8x382y8wmo=; b=VeVuItjIXy0SQn0doHT9YkJkE9sUtF19qBoE66CnyZni8a5cGpjbAptQy9ocKu4A3m Fgsu6EgfA2a4TJxbZ3JWW3pB+5oj0uyCpY501ALmg9VU4+Bq3AOTNkG4q9M+rYLgYoum +V1r7iebpLzVSn5SYfREG8dQsv0Nsn7/VD/H1AAqH+NkzioQd5IVPeBvpn2qDBdQY7Cd tX8YFEgpWe1W4pWOMz/jMxIeikOWw7YBmURN1ECN8arFMhkURlAdpfl2ldv76kTrMc00 BSvxZNrjNw0iwuuJpIffV6ocmxLki6iaDZgBd1jmm5kxbOMo44i7a5hjiqWG8LZnWXB6 zqig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=frvaZOEeTzFuUHcq938YEPXksp5CEcnni8x382y8wmo=; b=Tzd7oMN7ktM4BOBS8y7aOEAWPRbpYI44siYcOp2CNlMCmadICCpdpFWoXSicHOlaND vH5lXFIqMy8me0E96DBTJ4Obo0qqg1rhuBhNaUv5TSzUcpKOQZpOZvX+1MXRR9Zu8221 xRCpnd9kHgD/1LPMrvZItppWl8T2R36EECoNjp8Cj8gCq4pmHORklKf9U8mfHhjyxRFb DwHDlsQcrgRNRbOp7svpZpkSqJKc/4YCyRiIS4pZgsE7PNn+9e1xZl/nWTShQSiNqSix MYc7oyK4BZbqXehw+6u8LbSStM8k5FFJU0zqyV4nR2rdGhEzTFB5oO/IWaFkB/xuxaWZ VX1g== X-Gm-Message-State: AHQUAuaZ9P/YsKferzLebP0g2PWcVTHjuRSAqduxmM058SDDbgxqJjp/ X1vxOwp6KJbM5zSUuA+xsEbWVg== X-Received: by 2002:a63:1408:: with SMTP id u8mr414287pgl.271.1549922820192; Mon, 11 Feb 2019 14:07:00 -0800 (PST) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [174.3.196.123]) by smtp.gmail.com with ESMTPSA id w185sm16408609pfb.135.2019.02.11.14.06.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Feb 2019 14:06:59 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1gtJj8-0003Pd-P2; Mon, 11 Feb 2019 15:06:58 -0700 Date: Mon, 11 Feb 2019 15:06:58 -0700 From: Jason Gunthorpe To: Ira Weiny Cc: John Hubbard , 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: <20190211220658.GH24692@ziepe.ca> 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> <20190211215238.GA23825@iweiny-DESK2.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190211215238.GA23825@iweiny-DESK2.sc.intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) 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:52:38PM -0800, Ira Weiny wrote: > 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: > > > > 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. > > > > 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 think this should be done anyhow, it is trouble the two basically identical interfaces have different signatures. This already caused a bug in vfio.. I also wonder if someone should think about making fast into a flag too.. But I'm not sure when fast should be used vs when it shouldn't :( Jason