Soft-Updates

From
Jump to: navigation, search

Introduction

Soft Updates increases file system efficiency by ordering the disk writes so that every write creates a consistent state.

This allows all writes to happen asynchronously and to avoid seeks wherever possible.

File Dependencies

On a typical file system there are files, directories and pointers to these. A directory inode points to the direcotry data which points to either more directory nodes or to file inodes. The file inodes point to the file data.

If this chain is broken somewhere in between, for example if the directory points to inodes not (yet) written and the system crashes, it is in an inconsistent state.

Ordered Writes

Soft Updates' Solution to this is ordering the meta-data writes to disk to avoid such inconsistencies.

Dependency Tracking

To order these writes, the system needs to track which blocks need to be written to disk before others.

Please consider the example that one file is created an another is deleted, both in the same directory. (if you have problems imagining this, please refer to the fourth paper, page 8, or click on this link, while it lasts).

If dependency information is stored regarding only blocks, the directory block needs to be written before the inode block and vice versa.

To solve this, the system remembers dependency information for every single piece of data, either file or directory.

Still, in the state from the example, you can not write either block while guaranteeing consistency.

Roll-back

The solution to this is called roll-back:

One of the blocks is modified to a state that never existed and then written to disk. This extra write produces a sequences of consistent states

Crash recovery

As a result, whenever a crash occurs, the whole file system is in a consistent state in that no references point to some unused space.

There might be allocated blocks inside the system (mostly data) that are not used anywhere.

These can be found by doing a check in the background.

Efficiency

The speed increase in Soft Updates results from writing all of the meta-data operations asynchronously. In contrast with Journaling, no log is written to disk, producing no extra overhead. The only extra writes that occur are the roll-back writes and those resulting when the current state does not fit to memory any more.

In tests in the literature, SoftUpdates results in a speed increase of 30 to 660 %.

Links