Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp323817ybn; Tue, 1 Oct 2019 21:50:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtUn9QG5T4KJeLBEIGmev/sU/gKytq14YOwz1Q0cRufLsD+099gJTLuhYuGQwIEsQvyHQH X-Received: by 2002:a17:906:d04f:: with SMTP id bo15mr1440630ejb.296.1569991842341; Tue, 01 Oct 2019 21:50:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569991842; cv=none; d=google.com; s=arc-20160816; b=1KhqWS2cHU+lCPOHKux1GoiTRDQSUmeHmdNIK1ZflAkap4u35kuYVBCOm8SgFC/PnS IKtVICoQUjzcM6C9WfEbRm5Ou9hLPsLZXJjwENc0UF5HXNehNZbiaYcbgciZenukoLfN p0H3+XhrBPTy9OhKyWDvIaRAZ/efhyR2fLVr2ncVXxCSiIizA5I3SmHCVLoUC8L2cyRn IXgYEd2bstuupbmK+k4DXteQB4j+iEKgQBLqRSoqz7tMy8BEnBWC9s4/qUv6go1Tu8yt fwwBMRHjU6jfHQqSL5FpK4IO4EeTg0hnVVuXRsIpWSh4owme3ig6jaBGtZnOOMfz12Zo mh8g== 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=KYCTwmS4P62FxMHaJWm+O6ctUV0nYzc4RNmnsv8zcZc=; b=sSZBX/BzYIh/IE5cdAZ393UdA++SowtCNjtejsOZIxgbQfeDxGnSOSybThlai3SAoR xUNxDtEFlaqky89ZSQxEAAolMOYQ+z53SLH+UotCOZJGkObgmxv7h66paJwIyQMEpxaz sXSli8Hc0Bm6ccTqaTpTsfhjMQCK9TUxMonZEWyeRjWsoM/6/ypz4BUcGLh/7mYpfJFk 7gyObRXSPdI3jUxYo4fShIWAEOaItSbjmmby6gYRhu2JJPzMT0P9W5lIOaK/O+zQLLdo /Oi1UXLILqJ+v1FmFRy7xYKb5FObkmOU+PVkzPGS3DcvgG/l++sIauxLUej2NjKXde5M 7Qeg== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b4si12462727edk.331.2019.10.01.21.50.18; Tue, 01 Oct 2019 21:50:42 -0700 (PDT) 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727488AbfJAVB7 (ORCPT + 99 others); Tue, 1 Oct 2019 17:01:59 -0400 Received: from mga06.intel.com ([134.134.136.31]:60837 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726973AbfJAVB6 (ORCPT ); Tue, 1 Oct 2019 17:01:58 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Oct 2019 14:01:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,572,1559545200"; d="scan'208";a="343108957" Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by orsmga004.jf.intel.com with ESMTP; 01 Oct 2019 14:01:57 -0700 Date: Tue, 1 Oct 2019 14:01:57 -0700 From: Ira Weiny To: Dave Chinner Cc: linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, linux-mm@kvack.org, Jeff Layton , Jan Kara , Theodore Ts'o , John Hubbard , Dan Williams , Jason Gunthorpe Subject: Re: Lease semantic proposal Message-ID: <20191001210156.GB5500@iweiny-DESK2.sc.intel.com> References: <20190923190853.GA3781@iweiny-DESK2.sc.intel.com> <20190923222620.GC16973@dread.disaster.area> <20190925234602.GB12748@iweiny-DESK2.sc.intel.com> <20190930084233.GO16973@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190930084233.GO16973@dread.disaster.area> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 30, 2019 at 06:42:33PM +1000, Dave Chinner wrote: > On Wed, Sep 25, 2019 at 04:46:03PM -0700, Ira Weiny wrote: > > On Tue, Sep 24, 2019 at 08:26:20AM +1000, Dave Chinner wrote: > > > Hence, AFIACT, the above definition of a F_RDLCK|F_LAYOUT lease > > > doesn't appear to be compatible with the semantics required by > > > existing users of layout leases. > > > > I disagree. Other than the addition of F_UNBREAK, I think this is consistent > > with what is currently implemented. Also, by exporting all this to user space > > we can now write tests for it independent of the RDMA pinning. > > The current usage of F_RDLCK | F_LAYOUT by the pNFS code allows > layout changes to occur to the file while the layout lease is held. This was not my understanding. > IOWs, your definition of F_RDLCK | F_LAYOUT not being allowed > to change the is in direct contradition to existing users. > > I've said this several times over the past few months now: shared > layout leases must allow layout modifications to be made. I don't understand what the point of having a layout lease is then? > > Only > allowing an exclusive layout lease to modify the layout rules out > many potential use cases for direct data placement and p2p DMA > applications, How? I think that having a typical design pattern of multiple readers and only a single writer would actually make all these use cases easier. > not to mention conflicts with the existing pNFS usage. I apologize for not understanding this. My reading of the code is that layout changes require the read layout to be broken prior to proceeding. The break layout code does this by creating a F_WRLCK of type FL_LAYOUT which conflicts with the F_RDLCK of type FL_LAYOUT... int __break_lease(struct inode *inode, unsigned int mode, unsigned int type) { ... struct file_lock *new_fl, *fl, *tmp; ... new_fl = lease_alloc(NULL, want_write ? F_WRLCK : F_RDLCK, 0); if (IS_ERR(new_fl)) return PTR_ERR(new_fl); new_fl->fl_flags = type; ... list_for_each_entry_safe(fl, tmp, &ctx->flc_lease, fl_list) { if (!leases_conflict(fl, new_fl)) continue; ... } type == FL_LAYOUT from the call here. static inline int break_layout(struct inode *inode, bool wait) { smp_mb(); if (inode->i_flctx && !list_empty_careful(&inode->i_flctx->flc_lease)) return __break_lease(inode, wait ? O_WRONLY : O_WRONLY | O_NONBLOCK, FL_LAYOUT); return 0; } Also, I don't see any code which limits the number of read layout holders which can be present and all of them will be revoked by the above code. What am I missing? Ira