Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp795238ybi; Fri, 7 Jun 2019 17:59:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRWJFKRgtcmcIYX+UGV8eImPI8F3Vg/7VFw3SCKFc7EPgaezivMnqJre797QyPNiiFHh9x X-Received: by 2002:a17:90a:2446:: with SMTP id h64mr9150214pje.0.1559955562677; Fri, 07 Jun 2019 17:59:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559955562; cv=none; d=google.com; s=arc-20160816; b=pR6WWr9Q2VdGswRWnyqBpxaNUaLHADTVwLbOXSOtTFjDTR6U3G0XwRXavbmB7VPPkd EcTRklGSv7EHG6XFtxPo6B9XVmZ5w1/ivDXbSU/jTgEpj5RiVSEuunJ9QNrpptAPT2bX Q76k/2HtP6G97vNNK1/dkswVVO/DIMZE4IdUbkncQX5I2r4V3eKDag5enjzvaExdFjwe XfFTW5ZdvImCAk2YuYkbr+5xX9iYTwNdaopSRyZ1afxc7nVZJ31ssy9JcJ3p8maG89UF 4goCEiQ30mlz159vp12AmEQAMb0on2wlDEuD6KUhX9THKnizBm46E3i/wWthcssgsIOD KIbQ== 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; bh=9CbAY1HigVPB7K8XVj5rYJfAE+/UpCK4RfaLDRQIyQ4=; b=nPUl/ZZL5uIEZQEDiccGqL8yeVIrP7f3GHycO6HA33TPKZ/z/C5zMDHnSZxQbwYRT+ 6PcPFrlQwUAMiGR2Eb6nqOBVHN/odyNWEN8TxsGO7viSzxSCKBpw+Z9IecCC6UR5T3K4 IkkkRBAuSz6j9mxH0gCU750l8ma/xGG1+zwo10/T0cXlJkPg5Xpfyw4L1GffoBO06FAt qEIzxlTQRvYLuH5nRhF6J5wGYd6ZReSrPwK40xjKMceaterSj4QtNimiQ4NPtRf1WeZB njPoE/oSnwHG9brSQTDmcNUThVUIdb+Jq8L4VnaFb2D0SVklnlw8XwmTNUZEZBuFoQyD DNiw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 t8si3380499pgh.235.2019.06.07.17.58.54; Fri, 07 Jun 2019 17:59:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730490AbfFHALo (ORCPT + 99 others); Fri, 7 Jun 2019 20:11:44 -0400 Received: from mail104.syd.optusnet.com.au ([211.29.132.246]:38024 "EHLO mail104.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729685AbfFHALo (ORCPT ); Fri, 7 Jun 2019 20:11:44 -0400 Received: from dread.disaster.area (pa49-195-189-25.pa.nsw.optusnet.com.au [49.195.189.25]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 946BC43E794; Sat, 8 Jun 2019 10:11:34 +1000 (AEST) Received: from dave by dread.disaster.area with local (Exim 4.92) (envelope-from ) id 1hZOwO-0001iX-35; Sat, 08 Jun 2019 10:10:36 +1000 Date: Sat, 8 Jun 2019 10:10:36 +1000 From: Dave Chinner To: Ira Weiny Cc: Jan Kara , Dan Williams , Theodore Ts'o , Jeff Layton , Matthew Wilcox , linux-xfs@vger.kernel.org, Andrew Morton , John Hubbard , =?iso-8859-1?B?Suly9G1l?= Glisse , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, linux-ext4@vger.kernel.org, linux-mm@kvack.org, Jason Gunthorpe , linux-rdma@vger.kernel.org Subject: Re: [PATCH RFC 00/10] RDMA/FS DAX truncate proposal Message-ID: <20190608001036.GF14308@dread.disaster.area> References: <20190606014544.8339-1-ira.weiny@intel.com> <20190606104203.GF7433@quack2.suse.cz> <20190606220329.GA11698@iweiny-DESK2.sc.intel.com> <20190607110426.GB12765@quack2.suse.cz> <20190607182534.GC14559@iweiny-DESK2.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190607182534.GC14559@iweiny-DESK2.sc.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=P6RKvmIu c=1 sm=1 tr=0 cx=a_idp_d a=K5LJ/TdJMXINHCwnwvH1bQ==:117 a=K5LJ/TdJMXINHCwnwvH1bQ==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=dq6fvYVFJ5YA:10 a=QyXUC8HyAAAA:8 a=7-415B0cAAAA:8 a=q-LccRbQMXva6PWEi7oA:9 a=CjuIK1q_8ugA:10 a=biEYGPWJfzWAr4FL6Ov7:22 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Fri, Jun 07, 2019 at 11:25:35AM -0700, Ira Weiny wrote: > On Fri, Jun 07, 2019 at 01:04:26PM +0200, Jan Kara wrote: > > On Thu 06-06-19 15:03:30, Ira Weiny wrote: > > > On Thu, Jun 06, 2019 at 12:42:03PM +0200, Jan Kara wrote: > > > > On Wed 05-06-19 18:45:33, ira.weiny@intel.com wrote: > > > > > From: Ira Weiny > > > > > > > > So I'd like to actually mandate that you *must* hold the file lease until > > > > you unpin all pages in the given range (not just that you have an option to > > > > hold a lease). And I believe the kernel should actually enforce this. That > > > > way we maintain a sane state that if someone uses a physical location of > > > > logical file offset on disk, he has a layout lease. Also once this is done, > > > > sysadmin has a reasonably easy way to discover run-away RDMA application > > > > and kill it if he wishes so. > > > > > > Fair enough. > > > > > > I was kind of heading that direction but had not thought this far forward. I > > > was exploring how to have a lease remain on the file even after a "lease > > > break". But that is incompatible with the current semantics of a "layout" > > > lease (as currently defined in the kernel). [In the end I wanted to get an RFC > > > out to see what people think of this idea so I did not look at keeping the > > > lease.] > > > > > > Also hitch is that currently a lease is forcefully broken after > > > /lease-break-time. To do what you suggest I think we would need a new > > > lease type with the semantics you describe. > > > > I'd do what Dave suggested - add flag to mark lease as unbreakable by > > truncate and teach file locking core to handle that. There actually is > > support for locks that are not broken after given timeout so there > > shouldn't be too many changes need. > > > > > Previously I had thought this would be a good idea (for other reasons). But > > > what does everyone think about using a "longterm lease" similar to [1] which > > > has the semantics you proppose? In [1] I was not sure "longterm" was a good > > > name but with your proposal I think it makes more sense. > > > > As I wrote elsewhere in this thread I think FL_LAYOUT name still makes > > sense and I'd add there FL_UNBREAKABLE to mark unusal behavior with > > truncate. > > Ok I want to make sure I understand what you and Dave are suggesting. > > Are you suggesting that we have something like this from user space? > > fcntl(fd, F_SETLEASE, F_LAYOUT | F_UNBREAKABLE); Rather than "unbreakable", perhaps a clearer description of the policy it entails is "exclusive"? i.e. what we are talking about here is an exclusive lease that prevents other processes from changing the layout. i.e. the mechanism used to guarantee a lease is exclusive is that the layout becomes "unbreakable" at the filesystem level, but the policy we are actually presenting to uses is "exclusive access"... Cheers, Dave. -- Dave Chinner david@fromorbit.com