Log-structured file system

Log-structured file system

A log-structured filesystem is a file system design first proposed by John K. Ousterhout and Fred Douglis. Designed for high write throughput, all updates to data and metadata are written sequentially to a continuous stream, called a log.

Rationale

Conventional file systems tend to lay out files with great care for spatial locality and make in-place changes to their data structures in order to perform well on magnetic disks, which tend to seek relatively slowly.

The design of log-structured file systems is based on the hypothesis that this will no longer be effective because ever-increasing memory sizes on modern computers would lead to I/O becoming write-heavy because reads would be almost always satisfied from memory cache. A log-structured file system thus treats its storage as a circular log and writes sequentially to the head of the log. This maximizes write throughput on magnetic media by avoiding costly seeks.

Keeping a log has several important side effects:
* Writes create multiple, chronologically-advancing versions of both file data and meta-data. Some implementations make these old file versions nameable and accessible, a feature sometimes called time-travel or snapshotting. This is very similar to a versioning file system.
* Recovery from crashes is simpler. Upon its next mount, the file system does not need to walk all its data structures to fix any inconsistencies, but can reconstruct its state from the last consistent point in the log.
* Free space must be constantly reclaimed from the tail of the log to prevent the file system from becoming full when the head of the log wraps around to meet it. The tail itself can skip forward over data for which newer versions exist farther ahead in the log; the remainder is simply moved out of the way by appending it back to the head. To minimize the overhead incurred by this garbage collection, most implementations avoid purely circular logs and divide up their storage into segments or extents. The head of the log can then advance onto non-adjacent segments which are already free or which are less full than at the tail, thus reducing the amount of garbage collection I/O needed to reclaim space.

Implementations

* John K. Ousterhout and Mendel Rosenblum implemented the first log-structured file system for the Sprite operating system in 1992.Rosenblum, Mendel and Ousterhout, John K. (June 1990) - " [http://citeseer.ist.psu.edu/rosenblum90lfs.html The LFS Storage Manager] ". "Proceedings of the 1990 Summer Usenix". pp315-324.] Rosenblum, Mendel and Ousterhout, John K. (February 1992) - " [http://citeseer.ist.psu.edu/rosenblum91design.html The Design and Implementation of a Log-Structured File System] ". "ACM Transactions on Computer Systems, Vol. 10 Issue 1". pp26-52.]
* BSD-LFS, an implementation by Margo Seltzer was added to 4.4BSD, and was later ported to 386BSD. It lacked support for snapshots. It was removed from FreeBSD and OpenBSD, but still lives on in NetBSD.
* Plan 9's Fossil file system is also log-structured and supports snapshots.
* NILFS is a log-structured file system implementation for Linux by NTT/Verio which supports snapshots. As of May 2007, it is still in alpha and not ready for production use.
* LinLogFS (formerly dtfs) and LFS ( [http://logfs.sourceforge.net/ http://logfs.sourceforge.net/] ) are log-structured file system implementations for Linux. The latter was part of Google Summer of Code 2005. Both projects have been abandoned.
* [http://aiya.ms.mff.cuni.cz/lfs LFS] is another log-structured file system for Linux developed by Charles University, Prague. It was to include support for snapshots and indexed directories, but development has since ceased.
* [http://logfs.org/logfs/ LogFS] is a scalable flash filesystem for Linux, intended to replace JFFS2. Early in development.

Some kinds of storage media, such as flash memory and CD-RW, degrade slowly as they are written to and have a limited number of erase/write cycles at any one location. Log-structured file systems are sometimes used on these media because they make fewer in-place writes and thus prolong the life of the device by wear levelling. The more common such file systems include:

* UDF is a file system commonly used on optical discs.
* JFFS and its successor JFFS2 are simple Linux file systems intended for flash-based devices.
* YAFFS is a NAND flash-specific file system for many operating systems (including Linux).

Disadvantages

* The design rationale for log-structured file systems assumes that most reads will be optimized away by ever-enlarging memory caches. This assumption does not always hold:
** On magnetic media—where seeks are relatively expensive—the log structure may actually make reads much slower, since it fragments files that conventional file systems normally keep contiguous with in-place writes.
** On flash memory—where seek times are usually negligible—the log structure may not confer a worthwhile performance gain because write fragmentation has much less of an impact on write throughput.

References

See also

* Comparison of file systems


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Log-structured File System (BSD) — The Log Structured File System (or LFS) is an implementation of a log structured file system (a concept originally proposed and implemented by John Ousterhout), originally developed for BSD. It was removed from FreeBSD and OpenBSD; the NetBSD… …   Wikipedia

  • File system — For library and office filing systems, see Library classification. Further information: Filing cabinet A file system (or filesystem) is a means to organize data expected to be retained after a program terminates by providing procedures to store,… …   Wikipedia

  • Unix File System — Infobox filesystem full name = UNIX file system name = UFS developer = CSRG introduction os = 4.2BSD introduction date = partition id = directory struct = table file struct = bad blocks struct = max file size = 2^73 bytes (8 ZiB) max files no =… …   Wikipedia

  • Logic File System — The Logic File System is a research file system which replaces pathnames with expressions in propositional logic. It allows file metadata to be queried with a superset of the Boolean syntax commonly used in modern search engines.The actual name… …   Wikipedia

  • Journaling file system — For the IBM Journaled File System, see JFS (file system). A journaling file system is a file system that keeps track of the changes that will be made in a journal (usually a circular log in a dedicated area of the file system) before committing… …   Wikipedia

  • Common Log File System — (CLFS) is a general purpose logging subsystem that is accessible to both kernel mode as well as user mode applications for building high performance transaction logs. It was introduced with Windows Server 2003 R2 and included in later Windows OSs …   Wikipedia

  • Encrypting File System — The Encrypting File System (EFS) on Microsoft Windows is a feature introduced in version 3.0 of NTFS[1] that provides filesystem level encryption. The technology enables files to be transparently encrypted to protect confidential data from… …   Wikipedia

  • List of file systems — The following lists identify, characterize and link to more thorough information on computer file systems.Many older operating systems support only their one native file system, which does not bear any name apart from the name of the operating… …   Wikipedia

  • Sprite operating system — Infobox OS name = Sprite operating system caption = developer = University of California, Berkeley source model = ? kernel type = Monolithic kernel supported platforms = DECstation 5000 Model 200, SPARCstation 2 ui = ? family = Unix like latest… …   Wikipedia

  • Write Anywhere File Layout — Infobox Filesystem full name = Write Anywhere File Layout name = WAFL developer = NetApp introduction os = introduction date = partition id = directory struct = file struct = bad blocks struct = max filename size = max files no = max volume size …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”