Disk buffer

Disk buffer
The disk buffer sits on the controller board of the hard drive.

In computer storage, disk buffer (often ambiguously[citation needed] called disk cache or cache buffer[citation needed]) is the embedded memory in a hard drive acting as a buffer between the rest of the computer and the physical hard disk platter that is used for storage. Modern hard disks come with 8 to 64 MiB of such memory.


Since the late 1980s, nearly all disks sold have embedded microcontrollers and either an ATA, Serial ATA, SCSI, or Fibre Channel interface. The drive circuitry usually has a small amount of memory, used to store the bits going to and coming from the disk platter.

The disk buffer is physically distinct from and is used differently than the page cache typically kept by the operating system in the computer's main memory. The disk buffer is controlled by the microcontroller in the hard disk drive, and the page cache is controlled by the computer to which that disk is attached. The disk buffer is usually quite small, from 8 to 64 MiB, and the page cache is generally all unused physical memory. While data in the page cache is reused multiple times, the data in the disk buffer is rarely reused.[citation needed] In this sense, the terms disk cache and cache buffer are misnomers; the embedded controller's memory is more appropriately called the disk buffer.

Note that disk array controllers, as opposed to disk controllers, usually have normal cache memory of around 0.5–8 GiB.

Contents

Uses

Read-ahead/read-behind

When executing a read from the disk, the disk arm moves the read/write head to (or near) the correct track, and after some settling time the read head begins to pick up bits. Usually, the first sectors to be read are not the ones that have been requested by the operating system. The disk's embedded computer typically saves these unrequested sectors in the disk buffer, in case the operating system requests them later.

Speed matching

The speed of the disk's I/O interface to the computer almost never matches the speed at which the bits are transferred to and from the hard disk platter. The disk buffer is used so that both the I/O interface and the disk read/write head can operate at full speed.

Write acceleration

The disk's embedded microcontroller may signal the main computer that a disk write is complete immediately after receiving the write data, before the data are actually written to the platter. This early signal allows the main computer to continue working even though the data has not actually been written yet. This can be somewhat dangerous, because if power is lost before the data are permanently fixed in the magnetic media, the data will be lost from the disk buffer, and the file system on the disk may be left in an inconsistent state. On some disks, this vulnerable period between signaling the write complete and fixing the data can be arbitrarily long, as the write can be deferred indefinitely by newly arriving requests. For this reason, the use of write acceleration can be controversial. Consistency can be maintained, however, by using a battery-backed memory system for caching data — although this is typically only found in high end RAID controllers. Alternatively, the caching can simply be turned off when the integrity of data is deemed more important than write performance. Another option is to send data to disk in a carefully managed order and to issue "cache flush" commands in the right places, like the ZFS file system does.

Command queuing

Newer SATA and most SCSI disks can accept multiple commands while any one command is in operation through "command queuing" (see NCQ and TCQ). These commands are stored by the disk's embedded controller until they are completed. Should a read reference the data at the destination of a queued write, the to-be-written data will be returned. Command queuing is different from write acceleration in that the main computer's operating system is notified when data is actually written onto the magnetic media. The OS can use this information to keep the file system consistent through rescheduled writes.

Performance

Disk buffer sizes over 8MiB do not produce any performance gains.[1] Where a buffer is large and the throughput of the disk is slow, the data becomes cached for too long, resulting in degraded performance over equivalent disks with smaller buffers. This degradation occurs because of longer latencies when flush commands are sent to a disk with a full buffer.[2]

See also

References


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • Disk Buffer —   [dt. »Platten Puffer«], Disk Cache …   Universal-Lexikon

  • Disk cache — may refer to: Disk buffer, the small amount of buffer memory present on a hard drive. Page cache, the cache of disk pages kept by the operating systems, stored in unused main memory. General application level caching of data stored on the disk.… …   Wikipedia

  • Disk Cache —  der, (Festplatten Cache) spezieller Pufferspeicher (Cache) zur Verkürzung der Zugriffszeit auf Daten der Festplatte oder von anderen Speichermedien. Der Disk Cache wird vom Betriebssystem (genauer von einem Zusatzmodul wie SmartDrive oder… …   Universal-Lexikon

  • Disk-drive performance characteristics — are the attributes which control the time it takes to transfer (read or write) data between a computer and a data storage device (most typically disk storage) starting with the initial command from the computer or host until the storage device… …   Wikipedia

  • Disk Copy — Developer(s) Apple Computer Stable release 10.2 Operating system System Software 6, System 7, Mac OS 8, Mac OS 9, Mac OS X v10.0, Mac OS X v10.1, Mac OS X v10.2 …   Wikipedia

  • Buffer underrun — In computing, buffer underrun or buffer underflow is a state occurring when a buffer used to communicate between two devices or processes is fed with data at a lower speed than the data is being read from it. This requires the program or device… …   Wikipedia

  • Disk array controller — A disk array controller is a device which manages the physical disk drives and presents them to the computer as logical units. It almost always implements hardware RAID, thus it is sometimes referred to as RAID controller. It also often provides… …   Wikipedia

  • Buffer underrun — Im Computerbereich ist ein Buffer Underrun die Situation, in der ein Datenpuffer, der von einer Quelle beschrieben und von anderer Seite ausgelesen wird, plötzlich leer ist, weil die Quelle nicht schnell genug Daten liefert. Inhaltsverzeichnis 1… …   Deutsch Wikipedia

  • Hard disk drive — Hard drive redirects here. For other uses, see Hard drive (disambiguation). Hard disk drive Mechanical interior of a modern hard disk drive Date invented 24 December 1954 [1] …   Wikipedia

  • Data buffer — In computer science, a buffer is a region of a physical memory storage used to temporarily hold data while it is being moved from one place to another. Typically, the data is stored in a buffer as it is retrieved from an input device (such as a… …   Wikipedia

Share the article and excerpts

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