Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp3033929imj; Mon, 11 Feb 2019 12:39:48 -0800 (PST) X-Google-Smtp-Source: AHgI3IbtzABL6/BEAskd3qDL8cVmpvbq+qff0vaXqTabUS1I9ZGMzvS1i2mUO2MQABPPj17McW7/ X-Received: by 2002:a62:178f:: with SMTP id 137mr110424pfx.226.1549917588276; Mon, 11 Feb 2019 12:39:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549917588; cv=none; d=google.com; s=arc-20160816; b=Poc7bQ5gIa5q58AhwTAIiGvYD/xw187bn/vVklfEGzZQn3qhfnH71kcTPnEbl5HHc+ TZpMZFgIoSv7NvQ6U9igsm9zva3TEsSVQ8fwFkC0fnQAfVXcHRksboIECgbAl5iezu4z jZx0z1r/HtqCunDt697U+rOb7iuhFFlIVFKKxQHBDEF5YzjnftWvEXhsjzvN2uH6xopj xGx6a4MnT4QfPfh4CoOiQMclefEvoDTcx1E/ntEoTl9RwbyY5VbhBAnJNWbCjX6JcHci MNcVo8aaV2Gzr+XWKne2PCu0l2gIjIMH0ElzU4difBqR5hUGOvKtMpO2FDVlcflo2FoO YQgQ== 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=Ai5ng9siExeClUBgwfnBsfOAh7Ww0UnChKfm7GQwqy8=; b=Q/6sYS8pDsvRHg7Ep8DflvNoAYqokJOSoKooQNYd69vXy7h0YpZPqVYf9duWCgBW0o c25+o/ffVYHyWyVEwaWzn3DvAcZXMsuA/lgf7IlT9Bdjdblq12wUyk/VbTaelDvcbCgU SkfKJ8WYKmY6TACkpsSLknGh8zsKhqe8npBRd4CW6dvN6dNEYWMNOUIRvEB+2PNFPz1R RY/GXdKbbSv8fMSb5h7p9N2tVbQ+a6DSfk/Eu1rFZa4vhyUj/PANs74Ze6eUUd4xpNsC OvrPUlFlstIwQJVU6aQ2bSkp/h7u0/Cy7ka8Os72uicxnGzUJUaW+vKdN11uQp3FJLja 0MWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=fVw7r3Mq; 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 31si11209638plj.244.2019.02.11.12.39.31; Mon, 11 Feb 2019 12:39:48 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=fVw7r3Mq; 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 S1732934AbfBKSkp (ORCPT + 99 others); Mon, 11 Feb 2019 13:40:45 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:58872 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727850AbfBKSkp (ORCPT ); Mon, 11 Feb 2019 13:40:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding: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=Ai5ng9siExeClUBgwfnBsfOAh7Ww0UnChKfm7GQwqy8=; b=fVw7r3MqWnUJtTl6mhVkXjfp6 vM9c0a6AHbh6U4flVQBofzZmFJ7tWik+X7J/bOVW6acd8XxcqJUdUOFxACuHBcP2Xb03joVjDwJup yKI/y1HOhLWLkZeMt2EWaoAmg8w6l4Iy3pJpNi6iMlLw1JzPbw2sRi1bZh9vXkw/IH/CFJw+C+Dnh X5n1D5T13dh60kkz0g07H3phR8qFcQ8S5TEHS69AJPdUdJ3D1LeyRrw3GwIo+vNXFDGwWYPW4Nmdo jYQNctPjbwqrwZpGiOxpmaSQ30wm/1PC8CYlFMU0Sq6ilUE+vxNcAKdN7rd+uKFhyF7Wfe6iibTJd rhjUqcf9g==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gtGVU-0004zX-H5; Mon, 11 Feb 2019 18:40:40 +0000 Date: Mon, 11 Feb 2019 10:40:40 -0800 From: Matthew Wilcox To: Jason Gunthorpe Cc: Ira Weiny , Dan Williams , 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: <20190211184040.GF12668@bombadil.infradead.org> References: <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> <20190211181921.GA5526@iweiny-DESK2.sc.intel.com> <20190211182649.GD24692@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190211182649.GD24692@ziepe.ca> User-Agent: Mutt/1.9.2 (2017-12-15) 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: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.