Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp210726ybl; Mon, 12 Aug 2019 14:50:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqwK5L5+y7oh1dY1M8j9Z5yhQdNtYkE7dWMi1fX+PG5jOnHs7gcUH8M9TisUdm05ZmPZPKKD X-Received: by 2002:a63:460d:: with SMTP id t13mr31000245pga.205.1565646602363; Mon, 12 Aug 2019 14:50:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565646602; cv=none; d=google.com; s=arc-20160816; b=R/Zyy6kIm08ij983XObWAbiJPbKBMAmF2pLUxkiw48UYsQ9mhc0JV/xOT3H0PfI8vT tuLq20KyfJC0yvQ2Y2wa7c/M6KzfeL2SuWTVCK1sEaIgKAISimd0+9QDdq/Q8k/WAeXK tHEjcuRlvi8z5+emJnJG1t/I9jWcLkOhzjiuxeDKIK8YNmzrLKb7VP3ZlU6Da3V2TUqr R6jYtnoSV1QBqsG2zh8ij8rn/9/b1a4dcyQSsEnfayujMLVxKVLzlMQlyDBs8PLQsxqy SFzTTjTbKOZRWi5/3M7qe+6MkkuiqhabYNoTasaJ+7G8B2BLpbOkduKfmPZag+8RD/MJ t30w== 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=w5FfXQIDA7CSQDMr8nWR4gFb0gYzoUBhbehjdHH0JSY=; b=iquBd2+db2Mn3FaFO1XQh4iqg17K6Y5rhFGK37QFE5MjDLvgEqsKSTwkRWv7pCIblK spX7mTF5OCzdbJLO3h9yuE435PyFyoPBPc/tUBpAKk52gL6CC3FyyBVCeI71hd7LcAYj iaeJ4EiUNxdCvz5SKXWifgR1iOa9mU3iv1vAl0K1nZhLZJ7xb5Z8HZrzqZLsMeUKEaTz il0zQu1PK+Z8WDlS+aTQ5SljMUIlLv7ltOjs5GAxxJ9vQIanSPjiFK6FqlGU/reIqm4l b0+aQ6mxtDodDWBcUgX7lVkGfQ/HH9LHOgIpKZ9QbjUHnw3ZNVLTUZA3h2x7UZpNcF1a Og2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 w15si30091055ply.127.2019.08.12.14.49.40; Mon, 12 Aug 2019 14:50:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 S1727462AbfHLVs4 (ORCPT + 99 others); Mon, 12 Aug 2019 17:48:56 -0400 Received: from mga03.intel.com ([134.134.136.65]:15780 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726530AbfHLVs4 (ORCPT ); Mon, 12 Aug 2019 17:48:56 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga103.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) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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 >