Tail packing

From Wikipedia, the free encyclopedia

In computing, tail packing or tail merging is a feature of file systems whereby multiple "tails" of files are "packed" into a single allocation unit (block), in order to conserve space by reducing internal fragmentation. It can be considered a special case of block suballocation where the subblock size is always 1 byte.

Contents

[edit] Background

File systems have traditionally divided the disk into equally sized blocks to simplify their design and limit the worst-case fragmentation. Block sizes are typically multiples of 512 due to the size of hard disk sectors. When files are allocated by the traditional file system, only whole blocks can be allocated to individual files. But as file sizes are often not multiples of the file system block size, this design inherently results in the last blocks of files (called "tails") to occupy only a part of the block, resulting in what is called internal fragmentation (not to be confused with file system fragmentation).

[edit] Tail packing file systems

Some file systems have since been designed to take advantage of this unused space, and can pack the tails of several files in a single shared tail block. While this may, at first, seem like it would significantly increase file fragmentation, the negative effect can be mitigated with readahead features on modern operating systems – when dealing with short files, several tails may be close enough to each another to be read together, and thus a disk seek is not introduced. Such file systems often employ heuristics in order to determine whether tail packing is worthwhile in a given situation. In some scenarios where the majority of files are shorter than half the block size, tail packing can increase storage efficiency even more than twofold, compared to file systems without tail packing.[1]

This not only translates into conservation of disk space, but may also introduce performance increases, as due to higher locality of reference, less data has to be read, also translating into higher disk cache efficiency. However, these advantages can be negated by the increased complexity of implementation.[2]

As of December 2006, the only notable file systems with support for tail packing are ReiserFS and Reiser4.

[edit] Criticism

The ReiserFS file system is often criticized for its complexity, and being more prone to fragmentation than many other file systems, both potentially introduced by the tail packing functionality. This has led some people to suggest turning off tail packing (through the notail mount option) for performance-critical file systems.

[edit] See also

[edit] References

  1. ^ Hans Reiser (2001). Hard Disk usage, ReiserFS and Ext2fs. Retrieved on December 14, 2006.
  2. ^ Hans Reiser (2001). ReiserFS file system design. Retrieved on December 14, 2006.