HOME

TheInfoList



OR:

The Orlov block allocator is an
algorithm In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific Computational problem, problems or to perform a computation. Algorithms are used as specificat ...
to define where a particular
file File or filing may refer to: Mechanical tools and processes * File (tool), a tool used to ''remove'' fine amounts of material from a workpiece **Filing (metalworking), a material removal process in manufacturing ** Nail file, a tool used to gent ...
will reside on a given
file system In computing, file system or filesystem (often abbreviated to fs) is a method and data structure that the operating system uses to control how data is stored and retrieved. Without a file system, data placed in a storage medium would be one larg ...
(blockwise), so as to speed up disk operations.


Etymology

The scheme is named after its creator Grigoriy Orlov, who first posted, in 2000, a brief description and implementation for
OpenBSD OpenBSD is a security-focused, free and open-source, Unix-like operating system based on the Berkeley Software Distribution (BSD). Theo de Raadt created OpenBSD in 1995 by forking NetBSD 1.0. According to the website, the OpenBSD project em ...
of the technique, which was later used in the
BSD The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berk ...
Fast Filesystem
kernel Kernel may refer to: Computing * Kernel (operating system), the central component of most operating systems * Kernel (image processing), a matrix used for image convolution * Compute kernel, in GPGPU programming * Kernel method, in machine learnin ...
variants.


Background

The performance of a file system is dependent on many things; one of the crucial factors is just how that filesystem lays out files on the disk. In general, it is best to keep related items together. The Linux
ext2 The ext2 or second extended file system is a file system for the Linux kernel. It was initially designed by French software developer Rémy Card as a replacement for the extended file system (ext). Having been designed according to the same pr ...
and
ext3 ext3, or third extended filesystem, is a journaled file system that is commonly used by the Linux kernel. It used to be the default file system for many popular Linux distributions. Stephen Tweedie first revealed that he was working on extend ...
filesystems, for instance, have tried to spread directories on the cylinders of the disk. Imagine setting up a system with users' home directories in /home: if all the first-level directories within /home (i.e. the home directories for numerous users) are placed next to each other, there may be no space left for the contents of those directories. User files thus end up being placed far from the directories that contain them, and performance suffers. Spreading directories on the disc allows files in the same directory to remain more or less contiguous as their number and/or size grows, but there are some situations where this causes excessive spreading of the data on the disk's surface.


How it works

Essentially, the Orlov algorithm tries to distribute "top-level" directories on the assumption that each is unrelated to the others. Directories created in the root directory of a filesystem are considered top-level directories;
Theodore Ts'o Theodore (Ted) Yue Tak Ts'o (曹子德) (born 1968) is an American software engineer mainly known for his contributions to the Linux kernel, in particular his contributions to file systems. He is the Secondary developer and maintainer of e2fspro ...
added a special
inode The inode (index node) is a data structure in a Unix-style file system that describes a file-system object such as a file or a directory. Each inode stores the attributes and disk block locations of the object's data. File-system object attribute ...
flag that allows the system administrator to mark other directories as being top-level directories as well. If /home lives in the root filesystem, a simple chattr command will make the system treat it as a top-level directory. When creating a directory that is not in a top-level directory, the Orlov algorithm tries to put it into the same cylinder group as its parent. A little more care is taken, however, to ensure that the directory's contents will also be able to fit into that cylinder group; if there are not many inodes or blocks available in the group, the directory will be placed in a different cylinder group that has more resources available. The result of all this, hopefully, is much better locality for files that are truly related to each other and likely to be accessed together.


Performance

The Orlov block allocator was shown to offer performance gains on workloads that traverse directory trees on FreeBSD. , only one benchmark result for ext3, using the allocator seems to have been posted. The results are promising: the time required to traverse through a Linux kernel tree was reduced by roughly 30%.


Evolution

The Orlov scheme needs more rigorous benchmarking; it also needs some serious stress testing to demonstrate that performance does not degrade as the filesystem is changed over time.


References

{{reflist


External links


The Orlov block allocator

Orlov block allocator for ext3
e-mail from Theodore Ts'o to
Linus Torvalds Linus Benedict Torvalds ( , ; born 28 December 1969) is a Finnish software engineer who is the creator and, historically, the lead developer of the Linux kernel, used by Linux distributions and other operating systems such as Android. He also c ...
and Alexander Viro Unix file system technology