Re: [PATCH] 2.4.x write barriers (updated for ext3)

James Bottomley
2002-03-04T18:12:04Z

mason@suse.com said:
> Sorry, what do you mean by multi-threaded back end completion of the
> transaction?

It's an old idea from databases with fine grained row level locking. To alter
data in a single row, you reserve space in the rollback log, take the row
lock, write the transaction description, write the data, undo the transaction
description and release the rollback log space and row lock. These actions
are sequential, but there may be many such transactions going on in the table
simultaneously. The way I've seen a database do this is to set up the actions
as linked threads which are run as part of the completion routine of the
previous thread. Thus, you don't need to wait for the update to complete, you
just kick off the transaction. You are prevented from stepping on your own
transaction because if you want to alter the same row again you have to wait
for the row lock to be released. The row locks are the "barriers" in this
case, but they preserve the concept of transaction independence. Of course,
most DB transactions involve many row locks and you don't even want to get
into what the deadlock detection algorithms look like...

I always imagined a journalled filesystem worked something like this, since
most of the readers/writers will be acting independently there shouldn't be so
much deadlock potential.

James