From: Andrew Morton Subject: Re: [Acl-Devel] Version 0.8.60 for kernel 2.4.21 released Date: Mon, 14 Jul 2003 14:23:40 -0700 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20030714142340.57099077.akpm@osdl.org> References: <1058207183.15134.88.camel@sisko.scot.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: sct@redhat.com, acl-devel@bestbits.at, SteveD@redhat.com, linux-fsdevel@vger.kernel.org Return-path: Received: from air-2.osdl.org ([65.172.181.6]:63663 "EHLO mail.osdl.org") by vger.kernel.org with ESMTP id S270883AbTGNVQS (ORCPT ); Mon, 14 Jul 2003 17:16:18 -0400 To: Andreas Gruenbacher In-Reply-To: List-Id: linux-fsdevel.vger.kernel.org Andreas Gruenbacher wrote: > > > > > That's a bit of a problem! journal_release is _supposed_ to work the > > old way. It's a way of releasing buffers optimistically, without > > breaking any guarantees --- if you're lucky enough that the buffer can > > be freed immediately then you get a credit back, but there is no > > guarantee. Well the bigger problem was: CPU0 CPU1 get_write_access() get_write_access() release_buffer() journal_dirty_metadata -> it's not journalled. Splat. I don't think release_buffer() was ever correct. Unless all callers happened to be under lock_super() or something. Of course, it's #if'ed away in 2.4 anyway. > The effect of the current accounting logic is that some handles get > accounted for buffers they don't require, How so? > wile those handles that actually > get the credits get them for free. yup. And t_outstanding_credits ends up wrong. It's a rare occurrence and we have quite a lot of reserve so it doesn't hit in practice. Simpler would be to just bump t_outstanding_credits each time we move a buffer from BJ_Reserved to BJ_Metadata. > > The core problem here is the reliance on the bh lock for data > > synchronisation, which forces you to declare the transaction credit > > before you've done the locking which will tell you whether or not you > > need that credit in the first place. Using alternative locking would > > avoid that entirely. 2.5 uses the idea of locking based on different > > bits in the bh state, for example; that sounds like it would avoid your > > particular problem here nicely. > > That would work, and even with fewer pains. I will have to look if this > can be easily ported to 2.4 as well. AFAIK sleeping on b_wait waiting on > other bits than BH_Lock in 2.4 might deadlock, right? Yup. Sleeping locks are a scalability disaster, so they're all spinlocks in there. With the exception of lock_super() in ext3_orphan_add/del, and that lock_super() is being a problem too. So I'm OK with the optimistic try-it-oh-shucks approach to get_write_access(). But the credit accounting does need to be rethought and redone. I've 90% done that twice, ended up throwing them away.