X-Spam-Checker-Version: SpamAssassin 3.4.0-r929098 (2010-03-30) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham version=3.4.0-r929098 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by oss.sgi.com (8.14.3/8.14.3/SuSE Linux 0.8) with ESMTP id q0D7F0KH086884 for ; Fri, 13 Jan 2012 01:15:01 -0600 X-ASG-Debug-ID: 1326438898-00a9eb65e62197d0001-NocioJ Received: from oproxy9.bluehost.com (oproxy9.bluehost.com [69.89.24.6]) by cuda.sgi.com with SMTP id oRkbF01AnPup4bis for ; Thu, 12 Jan 2012 23:14:58 -0800 (PST) X-Barracuda-Envelope-From: tm@tao.ma X-Barracuda-Apparent-Source-IP: 69.89.24.6 Received: (qmail 2796 invoked by uid 0); 13 Jan 2012 07:14:58 -0000 Received: from unknown (HELO box585.bluehost.com) (66.147.242.185) by oproxy9.bluehost.com with SMTP; 13 Jan 2012 07:14:58 -0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tao.ma; s=default; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:References:Subject:CC:To:MIME-Version:From:Date:Message-ID; bh=DejZnNHFoLKem/DaQL+8zBpJ80QuQPymm1La9mEEqaQ=; b=MZyjOhZ2GYH1xPNqt/5/D3CKNkPUh88h/ipFQV97tCOQf2QNxXs/DHYdx115jkxs9a+PWsdcS0wcnseoURg0A/RSzIwYCDBcVm9ir7BgvLOdnxEq7m2oCgKdJlH0cLfY; Received: from [182.92.247.2] (helo=[10.32.101.229]) by box585.bluehost.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1RlbLl-0007f0-RN; Fri, 13 Jan 2012 00:14:58 -0700 Message-ID: <4F0FD9EB.5050707@tao.ma> Date: Fri, 13 Jan 2012 15:14:51 +0800 From: Tao Ma User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111109 Thunderbird/3.1.16 MIME-Version: 1.0 To: Dave Chinner CC: Allison Henderson , Ext4 Developers List , Lukas Czerner , xfs@oss.sgi.com Subject: Re: working on extent locks for i_mutex References: <4F0F9E97.1090403@linux.vnet.ibm.com> <20120113043411.GH2806@dastard> X-ASG-Orig-Subj: Re: working on extent locks for i_mutex In-Reply-To: <20120113043411.GH2806@dastard> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Identified-User: {1390:box585.bluehost.com:colyli:tao.ma} {sentby:smtp auth 182.92.247.2 authed with tm@tao.ma} X-Barracuda-Connect: oproxy9.bluehost.com[69.89.24.6] X-Barracuda-Start-Time: 1326438898 X-Barracuda-URL: http://cuda.sgi.com:80/cgi-mod/mark.cgi X-Virus-Scanned: ClamAV version 0.94.2, clamav-milter version 0.94.2 on oss.sgi.com X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=DKIM_SIGNED, DKIM_VERIFIED X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.85787 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- -0.00 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.00 DKIM_SIGNED Domain Keys Identified Mail: message has a signature X-Virus-Status: Clean On 01/13/2012 12:34 PM, Dave Chinner wrote: > On Thu, Jan 12, 2012 at 08:01:43PM -0700, Allison Henderson wrote: >> Hi All, >> >> I know this is an old topic, but I am poking it again because I've >> had some work items wrap up, and Im planning on picking up on this >> one again. I am thinking about implementing extent locks to replace >> i_mutex. So I just wanted to touch base with folks and see what >> people are working on because I know there were some folks out there >> that were thing about doing similar solutions. > > What locking API are you looking at? If you are looking at an > something like: > > read_range_{try}lock(lock, off, len) > read_range_unlock(lock, off, len) > write_range_{try}lock(lock, off, len) > write_range_unlock(lock, off, len) > > and implementing with an rbtree or a btree for tracking, then I > definitely have a use for it in XFS - replacing the current rwsem > that is used for the iolock. Range locks like this are the only > thing we need to allow concurrent buffered writes to the same file > to maintain the per-write exclusion that posix requires. Interesting, so xfs already have these range lock, right? If yes, any possibility that the code can be reused in ext4 since we have the same thing in mind but don't have any resource to work on it by now. btw, IIRC flock(2) uses a list to indicate the range lock, so if we can make these pieces of codes common, at least there are 3 places that can benefit from it. ;) Thanks Tao