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=-2.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_MUTT 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 F0BB9C282CE for ; Mon, 11 Feb 2019 22:07:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BAE2E218A3 for ; Mon, 11 Feb 2019 22:07:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="VeVuItjI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726876AbfBKWHB (ORCPT ); Mon, 11 Feb 2019 17:07:01 -0500 Received: from mail-pg1-f196.google.com ([209.85.215.196]:33935 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726358AbfBKWHB (ORCPT ); Mon, 11 Feb 2019 17:07:01 -0500 Received: by mail-pg1-f196.google.com with SMTP id d9so216874pgl.1 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=Z1vxhNBeHZqoSn7DIcuUci9r8rrems5HPnYTqSyXpVWJag5rlrD+nA9Tcy7hgiu885 adKrWWR6vD7/5ui/T4x+4MkoqePW1kEzWrKgNL9ldWIDJQBZbAWYLIH91Jw9vm83LsBR CPeQvZa4UJcmZj6+AQHln9dDqlf9CAV4Mky8OUlvmIUtYFTJ+ceeYbaxA7wfAKO9Fy/v mFlwaC4ipTAPLn5xLfyqfw7dscNW/LGjSCPP4o7FUeGETUMatX6TnqawRWcYGbTui/pr lK1lAeuQ1TwrLk6ygki6/M0bUF5TIGaRmQchpgxTMG4OlgXBvPYgN8zz5YCgBEKdaFD8 dNIw== X-Gm-Message-State: AHQUAuZJ8D75EBzWLMpEo3FtCtF9EC3OZGCs8agrakCByZKKxHKexnYz bUbYKHV2nCNGncu8vEndmxczxw== X-Google-Smtp-Source: AHgI3IZ3Sg2dYwry0xnVd2kkIyO7BtojbITxcGUNeN+yUGMttFQ5WIUzBHvDRJs1jhkxC23VOVoJ0Q== 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: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@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