Sub-Transactions
A small update to the BFS incompatibility: I've now ported the original logging structure to the R5 version of BFS as well, so that the tools like bfs_shell can now successfully mount "dirty" volumes, too. I also found another bug in Be's implementation, and needed to cut down the log entry array by one to make it work with larger transactions.
Now I am working on implementing sub transactions. If you have tried out Haiku and compiled some stuff or just redirected some shell output to a file, you undoubtedly are aware that this takes ages on the current system.
The reason for this is that BFS starts a new transaction for every write to a file that enlarges its file size - and that's indeed a very common case. Since writing back a transaction also includes flushing the drive caches, this isn't a very cheap operation - it slows down BFS a lot.
The original approach taken by Be Inc. was to combine several smaller transactions to a bigger transaction - problem solved. The downside to this approach is that you lose the ability to undo a transaction. If you need to undo some actions, you have to manually undo the changes in the transaction that would have belonged to the small transaction.
That works but also complicates the code a lot, and is a welcome for any kind of bugs (and that's one more reason why file systems take ages to become mature).
In Haiku, we introduce the concept of a sub transaction: you can start a transaction in the context of the current transaction, and then abort only the sub transaction instead of the whole thing. As soon as the sub transaction is acknowledged, its changes are merged with the parent transaction - at that point, you cannot revert its changes anymore, you can only still revert the whole transaction.
The only downside of this approach is that it uses more memory, as it has to store the changes of the sub transaction alongside those of the parent. The largest transaction that is possible with a standard BFS volume currently consists of 4096 blocks - so even the worst case should be acceptable.
If a sub transaction grows too much, it can be detached from its parent - since the parent transaction itself is done already, it can safely be written back to disk.
I hope to finish implementing sub transactions and use them in BFS until some time tomorrow. Depending on the number of bugs I add to the code, it might also go faster, though :-)
10 Comments:
I enjoy reading your posts, keep up the good work and posts! :)
Lastly I have some problems with Haiku booting (on image from haiku-os.org - 18.10) - my BootLoader is shouting something like 'no boot volume' (I doesn't noticed this kind of problem on earlies images - for example from 13.10)
How are you trying to boot it? Using VPC or on a real computer?
I'm trying on real computer - on Haiku HD Image (2005-10-18) from download section on haiku-os.org. Earlier version - 2005-10-13 from http://behaiku.altervista.org/ is booting very fast (10s.) without any problems.
18.10 image boots ok for me. Although I have to remove the radeon stuff since my laptop doesn't work correctly with the radeon driver (yet).
Keep up the good work Axel (and all the other active devs), nice to read about the daily progress and see all the check-ins lately.
-scottmc
Thanks for keeping us all up to date with what's going on under the hood.
I've now put a new image 19.10 up but borg1980, I think you'll still have issues as axel only implemented that BIOS issue today. Those changes will appear in 20.10 - in fact, I might do another run tonight (takes about 2 hours to build everything from the source on the current build machine).
> Thanks for keeping us all up to
> date with what's going on under
> the hood.
It's my pleasure :)
> Those changes will appear in 20.10
So, I'm waiting for 20.10.2005 now :)
definitly a pleasure to read those posts, as a non technical neither dev, it's so well explained each time that i understand more or less everything !
Thanks a lot !!
I tested 20.10 image. Still the same problem :(
It's my lucky day - 21.10 version is working good. Keep up great work Axel :)
Post a Comment
<< Home