Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1333477ybl; Tue, 13 Aug 2019 10:48:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqyD2LHZXkl2+rjovq1YMzVz7jYiqnERalJcPdGbo/j7NSOoh5GUgcslUKICpv98ttcHas0k X-Received: by 2002:aa7:8d88:: with SMTP id i8mr42849942pfr.28.1565718490329; Tue, 13 Aug 2019 10:48:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565718490; cv=none; d=google.com; s=arc-20160816; b=d5iZ9T9VS0czjFiU6iwCFgJlovtUOmf45j3GLBuEy4Lo2mFaOXJMYLNVdKcFT3pKpU E4nbLLXLVFsX3DCmNDMIfl36RuaONGwAmkytWysabRClWwcoBlEX3mNlLowXD3FYGYj3 ONDlDkZTyiJK9zR3GOP03XXHPqqX/mA5Oi6YrJHceehQgNiLAhUU30ws7OS6nbYZ7VNn lPRAYhtrO2amqu/aUSp+4236ORr9zVEecO7CyUlKP1hZZX4Jc8SRL8saZw53gJe5foiH IhaKOYrdvN3yGGtJmpfNmLEaKJMwhssAYChAtyDlwAgbqSOkpcIkGeqcbF/Kqkl5NO/Z ocoQ== 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=66diSealllb/EFc5mYiZqG4dlPQSljBbWVihv09jZ0s=; b=Cb24jtUWDzL2gWIeIgtAj3C/VGohKgUoRNaoQr6V7MZEzqlr3epfjnwcq7EehTpUN1 6WYdDmHCFqLLdOWpvnV1s8PU3236k/g7doXp4l61V6Gl6UqMhmux7SihbKlL0eAD4G0N Gpk/gZeNPvXM4o/VySY9Ix2Z4+KKkly4iIbo9EZJ+QstwhKPjDE1sGmzBndR3kO1idz+ eg7CQJwPdEmduPFQqD5Qa6mhxdDvYqsL6LFG/sYeRjogwfE3xi4tWixdi4TV55DwmyZk TFTnWaKqtSFLWlNawUsNS8vQZ9upG/lSCJyWY+/WEy3g63b0/+sVeyaJtWGI2y5MAQhz 6Esg== ARC-Authentication-Results: i=1; mx.google.com; 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 v24si97576plo.244.2019.08.13.10.47.53; Tue, 13 Aug 2019 10:48:10 -0700 (PDT) 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; 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 S1728125AbfHMRqh (ORCPT + 99 others); Tue, 13 Aug 2019 13:46:37 -0400 Received: from mga04.intel.com ([192.55.52.120]:46814 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726323AbfHMRqh (ORCPT ); Tue, 13 Aug 2019 13:46:37 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Aug 2019 10:46:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,382,1559545200"; d="scan'208";a="351604440" Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by orsmga005.jf.intel.com with ESMTP; 13 Aug 2019 10:46:35 -0700 Date: Tue, 13 Aug 2019 10:46:35 -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: <20190813174635.GC11882@iweiny-DESK2.sc.intel.com> References: <20190809225833.6657-1-ira.weiny@intel.com> <20190809225833.6657-16-ira.weiny@intel.com> <20190812122814.GC24457@ziepe.ca> <20190812214854.GF20634@iweiny-DESK2.sc.intel.com> <20190813114706.GA29508@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190813114706.GA29508@ziepe.ca> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 13, 2019 at 08:47:06AM -0300, Jason Gunthorpe wrote: > On Mon, Aug 12, 2019 at 02:48:55PM -0700, Ira Weiny wrote: > > 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. > > valloc is a kernel call Oh... I thought you meant this: https://linux.die.net/man/3/valloc > > > So I'm open to suggestions. Jan gave me this one, so I figured it was safer to > > suggest it... > > Should have the word user in it, imho Fair enough... user_addr_pin_pages(void __user * addr, ...) ? uaddr_pin_pages(void __user * addr, ...) ? I think I like uaddr... > > > > 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. > > That is actually a bug, converting from u64 to a 'user VA' needs to go > through u64_to_user_ptr(). Fair enough. But there are a lot of call sites throughout the kernel who have the same bug... I'm ok with forcing u64_to_user_ptr() to use this new call if others are. Ira