From owner-freebsd-fs Mon Feb 12 13:21:56 2001 Delivered-To: freebsd-fs@freebsd.org Received: from bingnet2.cc.binghamton.edu (bingnet2.cc.binghamton.edu [128.226.1.18]) by hub.freebsd.org (Postfix) with ESMTP id 5952737B4EC for ; Mon, 12 Feb 2001 13:21:35 -0800 (PST) Received: from opal (cs.binghamton.edu [128.226.123.101]) by bingnet2.cc.binghamton.edu (8.11.2/8.11.2) with ESMTP id f1CLLXu12978; Mon, 12 Feb 2001 16:21:33 -0500 (EST) Date: Mon, 12 Feb 2001 16:21:33 -0500 (EST) From: Zhiui Zhang X-Sender: zzhang@opal To: Russell Cattelan Cc: freebsd-fs@FreeBSD.ORG Subject: Re: Design a journalled file system In-Reply-To: <3A884C91.56037FFE@thebarn.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Mon, 12 Feb 2001, Russell Cattelan wrote: > Zhiui Zhang wrote: > > > On Mon, 12 Feb 2001, Russell Cattelan wrote: > > > > > > Another difficulty is that if several transactions are in progress at the > > > > same time, we must remember which metadata buffers are modified by which > > > > transactions. When we copy/rename the buffer, we must inform those > > > > transactions the fact that we did the copy/rename. The buffers modified > > > > by one transaction must be flushed at the same time. > > > > Thanks for your reply. I mean if a transaction locks down all the metadata > > (e.g., bitmap blocks) it modified until it commits, then there is no > > problem (but this reduces concurrency). Otherwise, the same metadata > > blocks can contain modifications done by more than one transaction. > > This really isn't a problem... meta data buffers have to be "pinned" but not > necessarily locked. A meta data buffer can be modified many times without > having to be written out to disk, take for example the super block, this will > get flushed out to disk occasionally but since it is being modified so often > most changes never get flushed. A log of each of those changes will > be in every transaction that touched the super block, but the super > block doesn't have to be written out every time. > The primary goal is to have a consistent file system not to be able > to rollback every change that happens. > It seems to me that I have failed to explain my point again. So an example may help. Suppose I have a bitmap block buffer. One transaction allocate some blocks from it, the other transaction free some blocks into it. If the bitmap block buffer is not locked for the duration of a transaction, then it could contain modifications made both transactions. The atomicity is violated unless you can make the two transactions merge into one later. On the other hand, if it is locked for a transaction and that transaction blocks for some other I/O, then performance will suffer (no one can use the bitmap block buffer for a while). -Zhihui To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message