Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp185649imj; Thu, 14 Feb 2019 18:12:58 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib2xZudEgCuTHP+m6tOLZzv+hnromk3liSdRMpKtuP0T4Y1nMO3nBv8LIMh9b2av53ZsSyf X-Received: by 2002:a65:4383:: with SMTP id m3mr2853618pgp.96.1550196778823; Thu, 14 Feb 2019 18:12:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550196778; cv=none; d=google.com; s=arc-20160816; b=uBhwzzcj7T68ImtYgiZDAygTQss/CE2NNklYfc6MlEcYUzarJIp5sC/ZINLXm+NdvR KcsoWN4yyNCFtsoEPrfhdx2jMCb/7+N3FmlRoqRMaQnq16GXmjH41yoKlw68Fh39Qdax J6IFCENPDAYGUjXYLhhjy5euJY6OMUKKHVvKg4ZUa8QkkyTG8KZxzSdH1lVb9yVKopo+ zvD3mHR1uF5TMjFNjivaL1K0kch2qmJxbCA5m909jO/j5XCqrh48GyDwXO3roqD/NEgy IS4YNas+XqKVOzxLExpm7wfuKqrD09wozAJvRqUPiI3hOVx0ivmb9oOKko/W99RkkheL QwTA== 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; bh=6V7GZEgaLdb3AGufdYxhSq8i0B6K6prabOK9Vgibzjs=; b=t17Lmsp3ZfEd4HgDAvc0YEnP5BeWJK5GATij3HoFhLo2/fWG5neA7MXDamquxLtqrL iakL2tsTljeiq7WOKhOL5viPR7JS8aPXrF+s6dX3GPVJ2bphr7i92nCq3zuwiP6QX8FM SydNurwszlWJYUBAZZWFNQJYv2QvzRZxKI9qvVnFif76FdnIaB9CTxBHB/SrTxVSvgeX jXDqinq4FybMHw2a4op42ql+SunK5xxdY1Gf1tJATJxY6hviDh3rY3KEokMyhhg3JVaC zNSVfFBVy0rdOQD3kvXnq4BToYqUOHFdD3cFwlVeM2wcs/X00Xo/PQ34Mwsqv6ToA4rh +MVQ== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q16si4038417pgh.185.2019.02.14.18.12.42; Thu, 14 Feb 2019 18:12:58 -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; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439923AbfBNU00 (ORCPT + 99 others); Thu, 14 Feb 2019 15:26:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54860 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387975AbfBNU00 (ORCPT ); Thu, 14 Feb 2019 15:26:26 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 22DF332FBC; Thu, 14 Feb 2019 20:26:26 +0000 (UTC) Received: from redhat.com (unknown [10.20.6.236]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A588B600C1; Thu, 14 Feb 2019 20:26:24 +0000 (UTC) Date: Thu, 14 Feb 2019 15:26:22 -0500 From: Jerome Glisse To: Jason Gunthorpe Cc: Dan Williams , Jan Kara , Dave Chinner , Christopher Lameter , Doug Ledford , Matthew Wilcox , Ira Weiny , lsf-pc@lists.linux-foundation.org, linux-rdma , Linux MM , Linux Kernel Mailing List , John Hubbard , Michal Hocko Subject: Re: [LSF/MM TOPIC] Discuss least bad options for resolving longterm-GUP usage by RDMA Message-ID: <20190214202622.GB3420@redhat.com> References: <0c868bc615a60c44d618fb0183fcbe0c418c7c83.camel@redhat.com> <01000168c8e2de6b-9ab820ed-38ad-469c-b210-60fcff8ea81c-000000@email.amazonses.com> <20190208044302.GA20493@dastard> <20190208111028.GD6353@quack2.suse.cz> <20190211102402.GF19029@quack2.suse.cz> <20190211180654.GB24692@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190211180654.GB24692@ziepe.ca> User-Agent: Mutt/1.10.0 (2018-05-17) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 14 Feb 2019 20:26:26 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 11, 2019 at 11:06:54AM -0700, Jason Gunthorpe wrote: > On Mon, Feb 11, 2019 at 09:22:58AM -0800, Dan Williams wrote: > > > I honestly don't like the idea that random subsystems can pin down > > file blocks as a side effect of gup on the result of mmap. Recall that > > it's not just RDMA that wants this guarantee. It seems safer to have > > the file be in an explicit block-allocation-immutable-mode so that the > > fallocate man page can describe this error case. Otherwise how would > > you describe the scenarios under which FALLOC_FL_PUNCH_HOLE fails? > > I rather liked CL's version of this - ftruncate/etc is simply racing > with a parallel pwrite - and it doesn't fail. > > But it also doesnt' trucate/create a hole. Another thread wrote to it > right away and the 'hole' was essentially instantly reallocated. This > is an inherent, pre-existing, race in the ftrucate/etc APIs. So it is kind of a // point to this, but direct I/O do "truncate" pages or more exactly after a write direct I/O invalidate_inode_pages2_range() is call and it will try to unmap and remove from page cache all pages that have been written too. So we probably want to think about what we want to do here if a device like RDMA has also pin those pages. Do we want to abort the invalidate ? Which would mean that then the direct I/O write was just a pointless exercise. Do we want to not direct I/O but instead memcpy into page cache memory ? Then you are just ignoring the direct I/O property of the write. Or do we want to both direct I/O to the block and also do a memcopy to the page so that we preserve the direct I/O semantics ? I would probably go with the last one. In any cases we will need to update the direct I/O code to handle GUPed page cache page. Cheers, J?r?me