From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Teigland Subject: Re: File system awareness (or lack thereof) of vfs granting of leases Date: Thu, 22 Feb 2007 16:57:43 -0600 Message-ID: <20070222225743.GD19768@redhat.com> References: <45D6937A.10902@redhat.com> <20070218063948.GC22022@fieldses.org> <20070220190817.GB3932@redhat.com> <38020.141.211.133.169.1172004714.squirrel@www.fieldses.org> <20070220212508.GD3932@redhat.com> <20070222215828.GE18622@fieldses.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Wendy Cheng , linux-fsdevel@vger.kernel.org To: "J. Bruce Fields" Return-path: Received: from mx1.redhat.com ([66.187.233.31]:56026 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752022AbXBVWzO (ORCPT ); Thu, 22 Feb 2007 17:55:14 -0500 Content-Disposition: inline In-Reply-To: <20070222215828.GE18622@fieldses.org> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, Feb 22, 2007 at 04:58:28PM -0500, J. Bruce Fields wrote: > I'm also curious--exposing my total ignorance of the dlm--why taking > such a lock would always be so expensive, or would always be required on > open. Surely the typical case should be one where there's no conflict > and never has been, in which case asking for the lock you need should be > a trivial local operation? Acquiring a dlm lock can require, 0, 1 or 2 remote requests, depending on the luck of a hash and whether another node has a lock on the same file. It's usually nonzero and you have to do a remote operation. You have to do a dlm operation on every open and every close of every file because you need to have a record of the opened state of the file (and mode) _in case_ someone tries to do a lease. If you removed these two rules (from fcntl man page) "A read lease can only be placed on a file descriptor that is opened read-only." "A write lease may be placed on a file only if no other process currently has the file open." it would become much easier because you could distribute only the current lease state across all the nodes and every open would just require a local check. Assuming there are far fewer leases than opens. Dave