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.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 BC2D5C433FF for ; Mon, 12 Aug 2019 21:49:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 83D192070C for ; Mon, 12 Aug 2019 21:49:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 83D192070C 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 385866B0006; Mon, 12 Aug 2019 17:49:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 335716B0007; Mon, 12 Aug 2019 17:49:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 227186B0008; Mon, 12 Aug 2019 17:49:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0175.hostedemail.com [216.40.44.175]) by kanga.kvack.org (Postfix) with ESMTP id 01F336B0006 for ; Mon, 12 Aug 2019 17:49:22 -0400 (EDT) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id A26998248AA1 for ; Mon, 12 Aug 2019 21:49:22 +0000 (UTC) X-FDA: 75815117364.08.play90_51c6a29d8bc2c X-HE-Tag: play90_51c6a29d8bc2c X-Filterd-Recvd-Size: 3446 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Mon, 12 Aug 2019 21:49:21 +0000 (UTC) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Aug 2019 14:48:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,379,1559545200"; d="scan'208";a="375391550" Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by fmsmga005.fm.intel.com with ESMTP; 12 Aug 2019 14:48:55 -0700 Date: Mon, 12 Aug 2019 14:48:55 -0700 From: Ira Weiny To: Jason Gunthorpe Cc: Andrew Morton , Dan Williams , Matthew Wilcox , Jan Kara , Theodore Ts'o , John Hubbard , Michal Hocko , Dave Chinner , linux-xfs@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-nvdimm@lists.01.org, linux-ext4@vger.kernel.org, linux-mm@kvack.org Subject: Re: [RFC PATCH v2 15/19] mm/gup: Introduce vaddr_pin_pages() Message-ID: <20190812214854.GF20634@iweiny-DESK2.sc.intel.com> References: <20190809225833.6657-1-ira.weiny@intel.com> <20190809225833.6657-16-ira.weiny@intel.com> <20190812122814.GC24457@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190812122814.GC24457@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, Aug 12, 2019 at 09:28:14AM -0300, Jason Gunthorpe wrote: > On Fri, Aug 09, 2019 at 03:58:29PM -0700, ira.weiny@intel.com wrote: > > From: Ira Weiny > > > > The addition of FOLL_LONGTERM has taken on additional meaning for CMA > > pages. > > > > In addition subsystems such as RDMA require new information to be passed > > to the GUP interface to track file owning information. As such a simple > > FOLL_LONGTERM flag is no longer sufficient for these users to pin pages. > > > > Introduce a new GUP like call which takes the newly introduced vaddr_pin > > information. Failure to pass the vaddr_pin object back to a vaddr_put* > > call will result in a failure if pins were created on files during the > > pin operation. > > Is this a 'vaddr' in the traditional sense, ie does it work with > something returned by valloc? ...or malloc in user space, yes. I think the idea is that it is a user virtual address. > > Maybe another name would be better? Maybe, the name I had was way worse... So I'm not even going to admit to it... ;-) So I'm open to suggestions. Jan gave me this one, so I figured it was safer to suggest it... :-D > > I also wish GUP like functions took in a 'void __user *' instead of > the unsigned long to make this clear :\ Not a bad idea. But I only see a couple of call sites who actually use a 'void __user *' to pass into GUP... :-/ For RDMA the address is _never_ a 'void __user *' AFAICS. For the new API, it may be tractable to force users to cast to 'void __user *' but it is not going to provide any type safety. But it is easy to change in this series. What do others think? Ira > > Jason >