From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kara Subject: Re: [LSF/MM TOPIC] Discuss least bad options for resolving longterm-GUP usage by RDMA Date: Fri, 8 Feb 2019 12:10:28 +0100 Message-ID: <20190208111028.GD6353@quack2.suse.cz> References: <20190206175233.GN21860@bombadil.infradead.org> <47820c4d696aee41225854071ec73373a273fd4a.camel@redhat.com> <01000168c43d594c-7979fcf8-b9c1-4bda-b29a-500efe001d66-000000@email.amazonses.com> <20190206210356.GZ6173@dastard> <20190206220828.GJ12227@ziepe.ca> <0c868bc615a60c44d618fb0183fcbe0c418c7c83.camel@redhat.com> <01000168c8e2de6b-9ab820ed-38ad-469c-b210-60fcff8ea81c-000000@email.amazonses.com> <20190208044302.GA20493@dastard> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20190208044302.GA20493@dastard> Sender: linux-kernel-owner@vger.kernel.org To: Dave Chinner Cc: Christopher Lameter , Doug Ledford , Dan Williams , Jason Gunthorpe , Matthew Wilcox , Jan Kara , Ira Weiny , lsf-pc@lists.linux-foundation.org, linux-rdma , Linux MM , Linux Kernel Mailing List , John Hubbard , Jerome Glisse , Michal Hocko List-Id: linux-rdma@vger.kernel.org On Fri 08-02-19 15:43:02, Dave Chinner wrote: > On Thu, Feb 07, 2019 at 04:55:37PM +0000, Christopher Lameter wrote: > > One approach that may be a clean way to solve this: > > 3. Filesystems that allow bypass of the page cache (like XFS / DAX) will > > provide the virtual mapping when the PIN is done and DO NO OPERATIONS > > on the longterm pinned range until the long term pin is removed. > > So, ummm, how do we do block allocation then, which is done on > demand during writes? > > IOWs, this requires the application to set up the file in the > correct state for the filesystem to lock it down so somebody else > can write to it. That means the file can't be sparse, it can't be > preallocated (i.e. can't contain unwritten extents), it must have zeroes > written to it's full size before being shared because otherwise it > exposes stale data to the remote client (secure sites are going to > love that!), they can't be extended, etc. > > IOWs, once the file is prepped and leased out for RDMA, it becomes > an immutable for the purposes of local access. > > Which, essentially we can already do. Prep the file, map it > read/write, mark it immutable, then pin it via the longterm gup > interface which can do the necessary checks. Hum, and what will you do if the immutable file that is target for RDMA will be a source of reflink? That seems to be currently allowed for immutable files but RDMA store would be effectively corrupting the data of the target inode. But we could treat it similarly as swapfiles - those also have to deal with writes to blocks beyond filesystem control. In fact the similarity seems to be quite large there. What do you think? Honza -- Jan Kara SUSE Labs, CR