Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3045203imj; Mon, 11 Feb 2019 12:52:25 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia0Pdlu8rOdwQx4ZfCbckwwTaT2Pd2CSlIlQEOAE5Y6QerHbUtm3dtPtVsV8ln5IkMk2z2Q X-Received: by 2002:a65:6544:: with SMTP id a4mr150322pgw.412.1549918345355; Mon, 11 Feb 2019 12:52:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549918345; cv=none; d=google.com; s=arc-20160816; b=gOPCrFF+RbNU79Av2S2c2k5C/WwDqyGUKXgflash//9apCY93uX3+t04MBk7CHynHb V6TkZel1wGqlLAQRGpRHaVzhNLaR/HrFhr8N9YwQz07HKzcnjqBON4JQ29g59CU1/hNh 6//3z7/9QKZiS3U05jgkfbK3zttg3ekOlVcVQZ2qQfR64ev4vm1mq8mRakD6pmU3wssC ShQQMoNeRRqCODhDurVT3OAido73tq5xSfV9q+wlPocPuOhsgLn25vnLJ9WoKoqWbS2z v1+cLKde6xPqqHnlrNNbmIDPU/iSoJcmaSfbreEPU4ZJEOtgE/9cHjbyr46kH58zlQti vm3A== 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:dkim-signature; bh=PlofGPK1avjEsw/QmRNa8WCLcUE+7hBOnwTBt8jUCMw=; b=iFt9f5293vtJUYH8W/rKvlzipSIwHwQ9eyjjHKzELDrt86SN8Kq1VTKsEOCcEb7QS0 TeF6os3MQHow+ZiMjasKM1SGoEMTsxL5BfhJHMVy0OA0dmvXLu0Tmfjis1qW8mrZi9ZL y6oYBw2rWNq4zaGJE0xIU5XHM8TVaFiHEoVbuWhBi0bujZ+XaDeXlzLXJ3weiJiCa6Aj 5BBqsq5Q43e6/eLjGRoS0V9EIeIPl+mWCFGvxpquHrai7Ipwlyou7LDopt2dTJtnbVax 3l1GL9371MTuhqoKTDAGTk7jbfKFoqd4KWgTAOe5v5cnNsJuduoKyQ9+/wFXDCUMDWKp Rjmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=Eu9dS9Qi; 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 c26si9875622pfd.2.2019.02.11.12.52.07; Mon, 11 Feb 2019 12:52:25 -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=@ziepe.ca header.s=google header.b=Eu9dS9Qi; 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 S1727173AbfBKUts (ORCPT + 99 others); Mon, 11 Feb 2019 15:49:48 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:41066 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727099AbfBKUts (ORCPT ); Mon, 11 Feb 2019 15:49:48 -0500 Received: by mail-pg1-f194.google.com with SMTP id m1so112430pgq.8 for ; Mon, 11 Feb 2019 12:49:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=PlofGPK1avjEsw/QmRNa8WCLcUE+7hBOnwTBt8jUCMw=; b=Eu9dS9QiH1mXijZ57nvyRLxXafPNQSUpE7A0KIWhVaD+0nVWDSJ5cRh6pntdBS25Mn ncuoRg637h9CDi94ozsiHQTU3r2IVpRskYTkXUtdRRAzvRo9CbKBEFSl5cUQSdM25YMk z414PObGbCTzSJ4dSf84jTlmJm1Q/G66C75pVMaYT5vaP+q8dESUpzF61VuzYS6W1df6 /tyH9w4OTKPOT1k3H1QlCPSY/dqCdhMfM0NAvUEeMiwYiHNOS2fjwRGQKaRYzIm07Jdy 6TXET+YjOF0a9uCkaWCLEG3rJJjq/W9jlQvqf1HpVn5iToEh+W3Zxwr31YZwiwu2CAnq vo7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=PlofGPK1avjEsw/QmRNa8WCLcUE+7hBOnwTBt8jUCMw=; b=YaqG3/ZcD0a24ROi8o2zFvpFgGqyUvjvXB8//sESs79jEMo22xDzyoG1gZFLFGLPJu z2ExANjgdnhJCd06bBSdXiRnlNG4qaSnxxvce6/zx9+2GtfzK/oQUe7hGjIKflZE/uwM Dd/giaiczZuevLnSkJARokhIr27QkX/WVxB3GH7mVMH8F7u1w0aP6cvZO9C5g+ZGeT3X HTIlmtDqyUU/o090rHUmigKosWACjznQztzE/cC4Dlq6pNqepe1PlErA5x+mtO29dlLk Cw3fy/Lb+ctZU6+jbqyrC16OzTgsv4mOHVEqEnFhXHiOl+t1OuPcpFTAW5Z4Cty2O2nI y0lg== X-Gm-Message-State: AHQUAuYPy7zmrmQWV/Rbb6BNatLmYo5L9spFXu/IJ0cL8z4K7gs/byUX pPC1M23tjqMhJjrdnAmt2t5EHSDFGxg= X-Received: by 2002:a62:2a4b:: with SMTP id q72mr139735pfq.61.1549918187431; Mon, 11 Feb 2019 12:49:47 -0800 (PST) Received: from ziepe.ca (S010614cc2056d97f.ed.shawcable.net. [174.3.196.123]) by smtp.gmail.com with ESMTPSA id t12sm11124722pgq.68.2019.02.11.12.49.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Feb 2019 12:49:46 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1gtIWP-0000or-RX; Mon, 11 Feb 2019 13:49:45 -0700 Date: Mon, 11 Feb 2019 13:49:45 -0700 From: Jason Gunthorpe To: Dan Williams Cc: Matthew Wilcox , Ira Weiny , Jan Kara , Dave Chinner , Christopher Lameter , Doug Ledford , 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 Message-ID: <20190211204945.GF24692@ziepe.ca> References: <20190208044302.GA20493@dastard> <20190208111028.GD6353@quack2.suse.cz> <20190211102402.GF19029@quack2.suse.cz> <20190211180654.GB24692@ziepe.ca> <20190211181921.GA5526@iweiny-DESK2.sc.intel.com> <20190211182649.GD24692@ziepe.ca> <20190211184040.GF12668@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) 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:58:47AM -0800, Dan Williams wrote: > On Mon, Feb 11, 2019 at 10:40 AM Matthew Wilcox wrote: > > > > On Mon, Feb 11, 2019 at 11:26:49AM -0700, Jason Gunthorpe wrote: > > > On Mon, Feb 11, 2019 at 10:19:22AM -0800, Ira Weiny wrote: > > > > What if user space then writes to the end of the file with a regular write? > > > > Does that write end up at the point they truncated to or off the end of the > > > > mmaped area (old length)? > > > > > > IIRC it depends how the user does the write.. > > > > > > pwrite() with a given offset will write to that offset, re-extending > > > the file if needed > > > > > > A file opened with O_APPEND and a write done with write() should > > > append to the new end > > > > > > A normal file with a normal write should write to the FD's current > > > seek pointer. > > > > > > I'm not sure what happens if you write via mmap/msync. > > > > > > RDMA is similar to pwrite() and mmap. > > > > A pertinent point that you didn't mention is that ftruncate() does not change > > the file offset. So there's no user-visible change in behaviour. > > ...but there is. The blocks you thought you freed, especially if the > system was under -ENOSPC pressure, won't actually be free after the > successful ftruncate(). They won't be free after something dirties the existing mmap either. Blocks also won't be free if you unlink a file that is currently still open. This isn't really new behavior for a FS. Jason