Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5055767ybh; Tue, 6 Aug 2019 23:36:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqz2aBG/pevos4Hyhq160BXe5R5BsAzb/M9RUYvNOLEfgRIqLMnKQ8pSFGQFxeEl9qIh3zrp X-Received: by 2002:a65:4546:: with SMTP id x6mr6273920pgr.266.1565159766722; Tue, 06 Aug 2019 23:36:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565159766; cv=none; d=google.com; s=arc-20160816; b=u9D65P6My2R26T1clvx8Vl/TFE29Pt9AVGv0Qou/tLGjh6A9dSkh+oii+nUPriPsoP vsqvSrtlMVg++rhJse/JbGD450VKwmpPcZJBXRNKG5LZGy2I8Xar9Qg3D/EKaSqFbTqJ 4sByLVas7srMl5U9ANvNrDY27eU+Sh2W9aT2j9czScAGQ/jfHzJs742brPemc7Bd6+zG 7Vg30Rv7KygzSXG/TOcYx8NPQ14i6YIqeKl+RzBGP+IRRlW+sOVP3S9UHlgYcHnj4qnL Ogfp0kW0lqDr5AqFQQXVrzvSaY/jgxjC0puMfAOwEVNHCcJ4xn/gu2NudPKcFXlVLUSF 3MkQ== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=h/YO9E7Kk2GlCfqzWsOaLMxcaYYFJaO+2uQZpeggUB0=; b=tKz4NNn8mNCmjOJXG64R1EjPplM+YE/zsLcIYLkwPRgiOyJCNaHaeNzkHpxgVIgors ivCh72FitwDuji6vB+X7MEQMgZfC2HaQf4nWM3boO+D5yNti1cfp+eHIqJazjgda/asU bq4b9jzngx1hTLXOeShM3O5AIT00AAFUi002X/N7nqGAdY4lfsa95e7btlc+zcfSrXlW JePMFBVyC855f+m277W0M1Unzv0PjsnCDdaxZduGoOQu5Kqbx2yp/a3Ns9V01fwAifWC UnJdeQKNcPEqkOJwvffMPqIWyiCCuDO3wn9ExIrNiw9/p9XhNpQnSEPc/J6plHh5MbMy r1Sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=otE89qYM; 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 c22si43856257plz.361.2019.08.06.23.35.51; Tue, 06 Aug 2019 23:36:06 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=otE89qYM; 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 S1727210AbfHGGfR (ORCPT + 99 others); Wed, 7 Aug 2019 02:35:17 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:36856 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726883AbfHGGfQ (ORCPT ); Wed, 7 Aug 2019 02:35:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=h/YO9E7Kk2GlCfqzWsOaLMxcaYYFJaO+2uQZpeggUB0=; b=otE89qYM9WmETe4AtaYSwZhaVp x2hWnzTkK/+H6YrywBw2CCvGkAGS0+cMqYBTGZ1bytkCsNKOywsxuaErRoaQPCJFZ74nyD+BaWD0D Fqio4bMq3iSkQd4EZDyn1AS+qiOZ+zvMv6fNRqFHw53t3ciAgH4Z1x8wvN/D7EYKreU7FK2EDXOVj PtXuttuf2InvZsTot7swxCxX4U2Gh/2vRud2yGtuCEvw7oeWsTGK9Fxhm2aMTINFjUbhDSIHyQW9d 1InA9ls8uWP73McSrAt6icdTTX2iY22SDv4qsGs3F3dJNdqSF3NdiMXvEekNoqV5nkE99PNfKXpGY TVYojzfw==; Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hvFX6-0004to-Ui; Wed, 07 Aug 2019 06:34:48 +0000 Date: Tue, 6 Aug 2019 23:34:48 -0700 From: Christoph Hellwig To: John Hubbard Cc: Christoph Hellwig , john.hubbard@gmail.com, Andrew Morton , Alexander Viro , Anna Schumaker , "David S . Miller" , Dominique Martinet , Eric Van Hensbergen , Jason Gunthorpe , Jason Wang , Jens Axboe , Latchesar Ionkov , "Michael S . Tsirkin" , Miklos Szeredi , Trond Myklebust , Christoph Hellwig , Matthew Wilcox , linux-mm@kvack.org, LKML , ceph-devel@vger.kernel.org, kvm@vger.kernel.org, linux-block@vger.kernel.org, linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, samba-technical@lists.samba.org, v9fs-developer@lists.sourceforge.net, virtualization@lists.linux-foundation.org Subject: Re: [PATCH 00/12] block/bio, fs: convert put_page() to put_user_page*() Message-ID: <20190807063448.GA6002@infradead.org> References: <20190724042518.14363-1-jhubbard@nvidia.com> <20190724061750.GA19397@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 05, 2019 at 03:54:35PM -0700, John Hubbard wrote: > On 7/23/19 11:17 PM, Christoph Hellwig wrote: > > On Tue, Jul 23, 2019 at 09:25:06PM -0700, john.hubbard@gmail.com wrote: > >> * Store, in the iov_iter, a "came from gup (get_user_pages)" parameter. > >> Then, use the new iov_iter_get_pages_use_gup() to retrieve it when > >> it is time to release the pages. That allows choosing between put_page() > >> and put_user_page*(). > >> > >> * Pass in one more piece of information to bio_release_pages: a "from_gup" > >> parameter. Similar use as above. > >> > >> * Change the block layer, and several file systems, to use > >> put_user_page*(). > > > > I think we can do this in a simple and better way. We have 5 ITER_* > > types. Of those ITER_DISCARD as the name suggests never uses pages, so > > we can skip handling it. ITER_PIPE is rejected іn the direct I/O path, > > which leaves us with three. > > > > Hi Christoph, > > Are you working on anything like this? I was hoping I could steer you towards it. But if you don't want to do it yourself I'll add it to my ever growing todo list. > Or on the put_user_bvec() idea? I have a prototype from two month ago: http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/gup-bvec but that only survived the most basic testing, so it'll need more work, which I'm not sure when I'll find time for.