Annotation of 43BSDReno/share/doc/smm/14.fastfs/2.t, revision 1.1

1.1     ! root        1: .\" Copyright (c) 1986 The Regents of the University of California.
        !             2: .\" All rights reserved.
        !             3: .\"
        !             4: .\" Redistribution and use in source and binary forms are permitted
        !             5: .\" provided that the above copyright notice and this paragraph are
        !             6: .\" duplicated in all such forms and that any documentation,
        !             7: .\" advertising materials, and other materials related to such
        !             8: .\" distribution and use acknowledge that the software was developed
        !             9: .\" by the University of California, Berkeley.  The name of the
        !            10: .\" University may not be used to endorse or promote products derived
        !            11: .\" from this software without specific prior written permission.
        !            12: .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
        !            13: .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
        !            14: .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
        !            15: .\"
        !            16: .\"    @(#)2.t 6.2 (Berkeley) 3/7/89
        !            17: .\"
        !            18: .ds RH Old file system
        !            19: .NH
        !            20: Old File System
        !            21: .PP
        !            22: In the file system developed at Bell Laboratories
        !            23: (the ``traditional'' file system),
        !            24: each disk drive is divided into one or more
        !            25: partitions.  Each of these disk partitions may contain
        !            26: one file system.  A file system never spans multiple
        !            27: partitions.\(dg
        !            28: .FS
        !            29: \(dg By ``partition'' here we refer to the subdivision of
        !            30: physical space on a disk drive.  In the traditional file
        !            31: system, as in the new file system, file systems are really
        !            32: located in logical disk partitions that may overlap.  This
        !            33: overlapping is made available, for example,
        !            34: to allow programs to copy entire disk drives containing multiple
        !            35: file systems.
        !            36: .FE
        !            37: A file system is described by its super-block,
        !            38: which contains the basic parameters of the file system.
        !            39: These include the number of data blocks in the file system,
        !            40: a count of the maximum number of files,
        !            41: and a pointer to the \fIfree list\fP, a linked
        !            42: list of all the free blocks in the file system.
        !            43: .PP
        !            44: Within the file system are files.
        !            45: Certain files are distinguished as directories and contain
        !            46: pointers to files that may themselves be directories.
        !            47: Every file has a descriptor associated with it called an
        !            48: .I "inode".
        !            49: An inode contains information describing ownership of the file,
        !            50: time stamps marking last modification and access times for the file,
        !            51: and an array of indices that point to the data blocks for the file.
        !            52: For the purposes of this section, we assume that the first 8 blocks
        !            53: of the file are directly referenced by values stored
        !            54: in an inode itself*.
        !            55: .FS
        !            56: * The actual number may vary from system to system, but is usually in
        !            57: the range 5-13.
        !            58: .FE
        !            59: An inode may also contain references to indirect blocks
        !            60: containing further data block indices.
        !            61: In a file system with a 512 byte block size, a singly indirect
        !            62: block contains 128 further block addresses,
        !            63: a doubly indirect block contains 128 addresses of further singly indirect
        !            64: blocks,
        !            65: and a triply indirect block contains 128 addresses of further doubly indirect
        !            66: blocks.
        !            67: .PP
        !            68: A 150 megabyte traditional UNIX file system consists
        !            69: of 4 megabytes of inodes followed by 146 megabytes of data.
        !            70: This organization segregates the inode information from the data;
        !            71: thus accessing a file normally incurs a long seek from the
        !            72: file's inode to its data.
        !            73: Files in a single directory are not typically allocated
        !            74: consecutive slots in the 4 megabytes of inodes,
        !            75: causing many non-consecutive blocks of inodes
        !            76: to be accessed when executing
        !            77: operations on the inodes of several files in a directory.
        !            78: .PP
        !            79: The allocation of data blocks to files is also suboptimum.
        !            80: The traditional
        !            81: file system never transfers more than 512 bytes per disk transaction
        !            82: and often finds that the next sequential data block is not on the same
        !            83: cylinder, forcing seeks between 512 byte transfers.
        !            84: The combination of the small block size,
        !            85: limited read-ahead in the system,
        !            86: and many seeks severely limits file system throughput.
        !            87: .PP
        !            88: The first work at Berkeley on the UNIX file system attempted to improve both
        !            89: reliability and throughput.
        !            90: The reliability was improved by staging modifications
        !            91: to critical file system information so that they could
        !            92: either be completed or repaired cleanly by a program
        !            93: after a crash [Kowalski78].
        !            94: The file system performance was improved by a factor of more than two by
        !            95: changing the basic block size from 512 to 1024 bytes.
        !            96: The increase was because of two factors:
        !            97: each disk transfer accessed twice as much data, 
        !            98: and most files could be described without need to access
        !            99: indirect blocks since the direct blocks contained twice as much data.
        !           100: The file system with these changes will henceforth be referred to as the
        !           101: .I "old file system."
        !           102: .PP
        !           103: This performance improvement gave a strong indication that
        !           104: increasing the block size was a good method for improving
        !           105: throughput.
        !           106: Although the throughput had doubled, 
        !           107: the old file system was still using only about
        !           108: four percent of the disk bandwidth.
        !           109: The main problem was that although the free list was initially
        !           110: ordered for optimal access,
        !           111: it quickly became scrambled as files were created and removed.
        !           112: Eventually the free list became entirely random,
        !           113: causing files to have their blocks allocated randomly over the disk.
        !           114: This forced a seek before every block access.
        !           115: Although old file systems provided transfer rates of up
        !           116: to 175 kilobytes per second when they were first created,
        !           117: this rate deteriorated to 30 kilobytes per second after a
        !           118: few weeks of moderate use because of this
        !           119: randomization of data block placement.
        !           120: There was no way of restoring the performance of an old file system
        !           121: except to dump, rebuild, and restore the file system.
        !           122: Another possibility, as suggested by [Maruyama76],
        !           123: would be to have a process that periodically
        !           124: reorganized the data on the disk to restore locality.
        !           125: .ds RH New file system
        !           126: .sp 2
        !           127: .ne 1i

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.