From mboxrd@z Thu Jan 1 00:00:00 1970 From: "J. Bruce Fields" Subject: Re: [PATCH] Remove BKL from fs/locks.c Date: Wed, 15 Sep 2010 16:42:03 -0400 Message-ID: <20100915204203.GA27837@fieldses.org> References: <201009142206.54130.arnd@arndb.de> <201009142239.02904.arnd@arndb.de> <201009142324.16074.arnd@arndb.de> <1284501356.10782.139.camel@heimdal.trondhjem.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Arnd Bergmann , Linus Torvalds , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Matthew Wilcox , Christoph Hellwig , Miklos Szeredi , Frederic Weisbecker , Ingo Molnar , John Kacur , Stephen Rothwell , Andrew Morton , Thomas Gleixner To: Trond Myklebust Return-path: Content-Disposition: inline In-Reply-To: <1284501356.10782.139.camel@heimdal.trondhjem.org> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Tue, Sep 14, 2010 at 05:55:56PM -0400, Trond Myklebust wrote: > On Tue, 2010-09-14 at 23:24 +0200, Arnd Bergmann wrote: > > On Tuesday 14 September 2010 22:53:31 Linus Torvalds wrote: > > > Oh well. I guess there's no incremental way to do things sanely. And > > > nobody has patches to fix those users, I guess. > > > > The only critical user is fs/lockd, I can easily handle the rest. > > When I talked to Bruce and Trond during LinuxCon, they told me that > > it should be possible to separate the bits of fs/lockd that lock > > against fs/locks.c and convert the former to use lock_flocks(). > > > The NFSv4 client is quite ready to just switch to using lock_flocks() > now. There is nothing that depends on the magical properties of the BKL. > I do also have someone working on BKL removal for the NLM/lockd client > and am hoping that should be ready in a couple of weeks time. > > The timeline for the server is up to Bruce, however. Looking over the server code.... The only code I see under the BKL is: - a few lease callbacks in fs/nfsd/nfs4state.c, none of which sleep at this point, so all should be fine under a spinlock or whatever we want. - fs/nfsd/nfs4state.c:check_for_locks(), which explicitly takes the BKL itself. All it does, though, is walk the lock list for a given file and check whether any of them have a given owner. It would be trivial to put it under some other lock and/or move it to locks.c. --b.