Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1802804imj; Fri, 8 Feb 2019 07:35:30 -0800 (PST) X-Google-Smtp-Source: AHgI3IYUkogjJSEKHAfdJTAQxrRS6xU1ZvyKomFKJHh2AKlVyw8H9qJmsWYyG5FtTEGnhmv1PsH+ X-Received: by 2002:a63:1a5f:: with SMTP id a31mr16828054pgm.335.1549640130181; Fri, 08 Feb 2019 07:35:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549640130; cv=none; d=google.com; s=arc-20160816; b=gqzO+BHjJcumfqCRhKpsmEXph5ftYLSI4nT9H7IWqq7HChe8zPU1S9mhnTm8h+ADvO 1d53R5bkoNfGME3qRG6dm3RvkdNVslMnUcT4DPBUfkgAk9s4FViCfJSyXL0JikZi53wm gb4YKVylUERB1vbGy1cun17p4SAFCINlBt5bnMK6DINV0AIajxCsn4x1iq3aMh1Kl2Th xXCUVI89o0QU+qW2wDpaiKZq/sBXMM1u2lWPSHW5ZYxBx3cRia8XlVKmxcCZSNloHPrY kX3eIt78uImGiVwTnoLgHOg6unVNwp0qzgLlJBxqcM+/hY0IgRPwNt4E0XxIUOaaKqRf wtHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:mime-version:user-agent :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=dudYlflGa1PTisipnwJdjwuKifAFehwnAnNXxUD3VNA=; b=WWniw5o4mfQKSgIudG35FpZX1Uw4Uao4+rN42elgQ2gv8hYbvJ3EDQCf+1QB0jtMLz iJHtS3FDaufS5InpTyZFOw4Wl31HUdnfadlVlDRW8CpoGXiLao2JdXPoiqinS9OU3jjW fJjOEMgYIpyCeJPoHeQhfYJM5KLKnn+IgY2+ukC/mkFljJv5F1N0wy6hxw9jAAUr8/mq LAwHTHdyUXO7MN9YZ5TqwbL0QQXbrH7kNl/CMfP5jGWqhp/tpOPdbKoDw4Jka+uhmBb9 V7eFeHcuAfnsdbOSAU4RRnNnUdN4RTYJ9kUlfcWA83zUZUrFIy1vFVYANWSbGQzXZP8R /2lQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=DcdwDK8G; 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 c8si2328156pgl.507.2019.02.08.07.35.13; Fri, 08 Feb 2019 07:35:30 -0800 (PST) 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=pass header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=DcdwDK8G; 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 S1727898AbfBHPdu (ORCPT + 99 others); Fri, 8 Feb 2019 10:33:50 -0500 Received: from a9-35.smtp-out.amazonses.com ([54.240.9.35]:56292 "EHLO a9-35.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727473AbfBHPdu (ORCPT ); Fri, 8 Feb 2019 10:33:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1549640028; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=YzFUGu859kPEo2hZyafj6+czbU6iIrLvVd2hSFt0EA0=; b=DcdwDK8GKlrlp+j/BPj49Ohwy5qY4VbMcl1vFGR69Au2TBSk47MucreBAWCc/qIM oKa96zjU9ZDlHhlf3j+o6aYmPUWAjAuZnFWwo6Ln1lLfSreZPnALHsN9wQvK0WYnnUV eEb2bAdYLQaF0V1pEq/QP6B5FwSq0xolmm5GhEI4= Date: Fri, 8 Feb 2019 15:33:48 +0000 From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Dave Chinner cc: 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 Subject: Re: [LSF/MM TOPIC] Discuss least bad options for resolving longterm-GUP usage by RDMA In-Reply-To: <20190208044302.GA20493@dastard> Message-ID: <01000168cdbe520b-2b2be741-8ceb-4a5d-92f2-9f68795d7db3-000000@email.amazonses.com> References: <20190206173114.GB12227@ziepe.ca> <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> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SES-Outgoing: 2019.02.08-54.240.9.35 Feedback-ID: 1.us-east-1.fQZZZ0Xtj2+TD7V5apTT/NrT6QKuPgzCT/IC7XYgDKI=:AmazonSES Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 8 Feb 2019, 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? If a memory region is mapped by RDMA then this is essentially a long write. The allocation needs to happen then. > 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. Yes. That is required. > IOWs, once the file is prepped and leased out for RDMA, it becomes > an immutable for the purposes of local access. The contents are mutable but the mapping to the physical medium is immutable. > 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. > > Simple to implement, the reasons for errors trying to modify the > file are already documented and queriable, and it's hard for > applications to get wrong. Yup. Why not do it this way? Just make the sections actually long term GUP mapped inmutable and not subject to the other page cache things. This is basically a straight through bypass of the page cache for a file. HEY! It may be used to map huge pages in the future too!!