Gs Orakom - m5
Gs Orakom - m5
M5 External Memory
5.1 INTRODUCTION
This section (external memory) examines a range of external memory devices and
systems. We begin with the most important device, the magnetic disk. Magnetic
disks are the foundation of external memory on virtually all computer systems. The
next section examines the use of disk arrays to achieve greater performance, looking
specifically at the family of systems known as RAID (Redundant Array of
Independent Disks).
Data are recorded on and later retrieved from the disk via a conducting coil named
Page 1 of 20
7097 – NIZIRWAN ANWAR
the head, in many systems, there are two heads, a read head and a write head. The
write mechanism exploits the fact that electricity flowing through a coil produces a
magnetic field. Electric pulses are sent to the write head, and the resulting magnetic
patterns are recorded on the surface below, with different patterns for positive and
negative currents. material and is in the shape of a rectangular doughnut with a gap
along one side and a few turns of conducting wire along the opposite side (figure
5.1). An electric current in the wire induces a magnetic field across the gap, which in
turn magnetizes a small area of the recording medium. Reversing the direction of the
current reverses the direction of the magnetization on the recording medium.
The head is a relatively small device capable of reading from or writing to a portion of
the platter rotating beneath it. This gives rise to the organization of data on the
platter in a concentric set of rings, called tracks. Each track is the same width as the
head. There are thousands of tracks per surface.
Figure 6.2 depicts this data layout. Adjacent tracks are separated by intertrack gaps.
This prevents, or at least minimizes, errors due to misalignment of the head or
simply interference of magnetic fields. Data are transferred to and from the disk in
sectors.
Page 2 of 20
7097 – NIZIRWAN ANWAR
Table 6.1 lists the major characteristics that differentiate among the various types of
magnetic disks. First, the head may either be fixed or movable with respect to the
radial direction of the platter. In a fixed-head disk, there is one read-write head per
track. All of the heads are mounted on a rigid arm that extends across all tracks;
such systems are rare today. In a movable-head disk, there is only one read-write
head.
Page 3 of 20
7097 – NIZIRWAN ANWAR
The disk itself is mounted in a disk drive, which consists of the arm, a spindle that
rotates the disk, and the electronics needed for input and output of binary data. A
nonremovable disk is permanently mounted in the disk drive; the hard disk in a
personal computer is a nonremovable disk. A removable disk can be removed and
replaced with another disk.
Page 4 of 20
7097 – NIZIRWAN ANWAR
The actual details of disk I/O operation depend on the computer system, the
operating system, and the nature of the I/O channel and disk controller hardware. A
general timing diagram of disk I/O transfer is shown in Figure 6.4. When the disk
drive is operating, the disk is rotating at constant speed. Track selection involves
moving the head in a movable-head system or electronically selecting one head on a
fixed-head system. On a movable-head system, the time it takes to position the head
at the track is known as seek time. In either case, once the track is selected, the disk
controller waits until the appropriate sector rotates to line up with the head. The time
it takes for the beginning of the sector to reach the head is known as rotational delay,
or rotational latency. The sum of the seek time, if any, and the rotational delay
equals the access time, which is the time it takes to get into position to read or write.
Once the head is in position, the read or write operation is then performed as the
sector moves under the head; this is the data transfer portion of the operation; the
time required for the transfer is the transfer time.
Seek Time is the time required to move the disk arm to the required
track. It turns out that this is a difficult quantity to pin down.
The seek time consists of two key components: the initial
startup time, and the time taken to traverse the tracks that
have to be crossed once the access arm is up to speed.
Unfortunately, the traversal time is not a linear function of the
number of tracks, but includes a settling time (time after
positioning the head over the target track until track
identification is confirmed). Much improvement comes from
smaller and lighter disk components. Some years ago, a
Page 5 of 20
7097 – NIZIRWAN ANWAR
where
T = transfer time
b = number of bytes to be transferred
N = number of bytes on a track
r = rotation speed, in revolutions per second
Thus the total average read or write time Ttotal can be expressed as
where Ts is the average seek time. Note that on a zoned drive, the number of bytes
per track is variable, complicating the calculation.
Timing Comparison, with the foregoing parameters defined, let us look at two
different I/O operations that illustrate the danger of relying on
average values. Consider a disk with an advertised average
seek time of 4 ms, rotation speed of 15,000 rpm, and 512-
byte sectors with 500 sectors per track. Suppose that we
Page 6 of 20
7097 – NIZIRWAN ANWAR
[1] RAID is a set of physical disk drives viewed by the operating system as a
single logical drive.
[2] Data are distributed across the physical drives of an array in a scheme
known as striping, described subsequently.
[3] Redundant disk capacity is used to store parity information, which
guarantees data recoverability in case of a disk failure.
The details of the second and third characteristics differ for the different RAID levels.
RAID 0 and RAID 1 do not support the third characteristic.
Page 7 of 20
7097 – NIZIRWAN ANWAR
RAID level 0 is not a true member of the RAID family because it does not include
redundancy to improve performance. However, there are a few applications, such as
some on supercomputers in which performance and capacity are primary concerns
and low cost is more important than improved reliability. For RAID 0, the user and
system data are distributed across all of the disks in the array. This has a notable
advantage over the use of a single large disk: If twodifferent I/O requests are
pending for two different blocks of data, then there is a good chance that the
requested blocks are on different disks. Thus, the two requests can be issued in
parallel, reducing the I/O queuing time. A set of logically consecutive strips that maps
exactly one strip to each array member is referred to as a stripe.
Page 8 of 20
7097 – NIZIRWAN ANWAR
There are a number of positive aspects to the RAID 1 (figure 5.6) organization;
[1] A read request can be serviced by either of the two disks that contains the
requested data, whichever one involves the minimum seek time plus
rotational latency.
[2] A write request requires that both corresponding strips be updated, but this
can be done in parallel. Thus, the write performance is dictated by the
slower of the two writes (i.e., the one that involves the larger seek time
plus rotational latency). However, there is no “write penalty” with RAID 1.
RAID levels 2 through 6 involve the use of parity bits. Therefore, when a
single strip is updated, the array management software must first compute
and update the parity bits as well as updating the actual strip in question.
[3] Recovery from a failure is simple. When a drive fails, the data may still be
accessed from the second drive.
RAID levels 2 and 3 make use of a parallel access technique. In a parallel access
Page 9 of 20
7097 – NIZIRWAN ANWAR
array, all member disks participate in the execution of every I/O request. In the case
of RAID 2
and 3, the strips are very small, often as small as a single byte or word. With RAID 2,
an error-correcting code is calculated across corresponding bits on each data disk,
and the bits of the code are stored in the corresponding bit positions on multiple
parity disks. Typically, a Hamming code is used, which is able to correct single-bit
errors and detect double-bit errors.
Page 10 of 20
7097 – NIZIRWAN ANWAR
Redundancy, in the event of a drive failure, the parity drive is accessed and data is
reconstructed from the remaining devices. Once the failed drive is
replaced, the missing data can be restored on the new drive and
operation resumed. Data reconstruction is simple. Consider an array
of five drives in which X0 through X3 contain data and X4 is the
parity disk. The parity for the ith bit is calculated as follows:
Performance, because data are striped in very small strips, RAID 3 can
achievevery high data transfer rates. Any I/O request will involve
the parallel transfer of data from all of the data disks. For large
transfers, the performance improvement is especially noticeable.
Page 11 of 20
7097 – NIZIRWAN ANWAR
the user data but also the corresponding parity bits. Consider an array of five drives
in which X0 through X3 contain data and X4 is the parity disk. Suppose that a write is
performed that only involves a strip on disk X1. Initially, for each bit i, we have the
following relationship:
After the update, with potentially altered bits indicated by a prime symbol:
Page 12 of 20
7097 – NIZIRWAN ANWAR
The advantage of RAID 6 is that it provides extremely high data availability. Three
disks would have to fail within the MTTR (mean time to repair) interval to cause data
to be lost. On the other hand, RAID 6 incurs a substantial write penalty, because
each write affects two parity blocks. Performance benchmarks [EISC07] show a
RAID 6 controller can suffer more than a 30% drop in overall write performance
Page 13 of 20
7097 – NIZIRWAN ANWAR
Page 14 of 20
7097 – NIZIRWAN ANWAR
As the cost of flash-based SSDs has dropped and the performance and bit density
increased, SSDs have become increasingly competitive with HDDs. Table 5.2 shows
typical measures of comparison at the time of this writing. SSDs have the following
advantages and dis- advantages over HDDs:
High-performance input/output operations per second (IOPS): Significantly
increases performance I/O subsystems.
Durability: Less susceptible to physical shock and vibration.
Longer lifespan: SSDs are not susceptible to mechanical wear.
Lower power consumption: SSDs use considerably less power than
comparable-size HDDs.
Quieter and cooler running capabilities: Less space required, lower energy
costs, and a greener enterprise.
Lower access times and latency rates: Over 10 times faster than the
spinning disks in an HDD.
Figure 5.12 illustrates a general view of the common architectural system component
associated with any SSD system. On the host system, the operating system invokes
file system software to access data on the disk. The file system, in turn, invokes I/O
driver software. The I/O driver software provides host access to the particular SSD
product. The interface component in Figure 6.8 refers to the physical and electrical
interface between the host processor and the SSD peripheral device. If the device is
an internal hard drive, a common interface is PCIe. For external devices, one
common interface is USB.
Page 15 of 20
7097 – NIZIRWAN ANWAR
In addition to the interface to the host system, the SSD contains the following
components:
Page 16 of 20
7097 – NIZIRWAN ANWAR
In 1983, one of the most successful consumer products of all time was introduced:
the compact disk (CD) digital audio system. The CD is a nonerasable disk that can
store more than 60 minutes of audio information on one side. The huge commercial
success of the CD enabled the development of low-cost optical-disk storage
technology that has revolutionized computer data storage. A variety of optical-disk
systems have been introduced (Table 5.4). Information is retrieved from a CD or CD-
ROM by a low-powered laser housed in an optical-disk player, or drive unit. The
laser shines through the clear polycarbonate while a motor spins the disk past it
(Figure 5.13)
Page 17 of 20
7097 – NIZIRWAN ANWAR
Data on the CD-ROM are organized as a sequence of blocks. A typical block format
is shown in Figure 5.14. It consists of the following fields:
Page 18 of 20
7097 – NIZIRWAN ANWAR
Header The header contains the block address and the mode byte.
Mode 0 specifies a blank data field; mode 1 specifies the use of an error-
correcting code and 2048 bytes of data; mode 2 specifies 2336 bytes of
user data with no error-correcting code.
Data User data.
Auxiliary Additional user data in mode 2. In mode 1, this is a 288-byte
errorcorrecting code.
Page 19 of 20
7097 – NIZIRWAN ANWAR
Problems M5
1. Consider a magnetic disk drive with 8 surfaces, 512 tracks per surface,
and 64 sectors per track. Sector size is 1 kB. The average seek time is 8
ms, the track-to-track access time is 1.5 ms, and the drive rotates at 3600
rpm. Successive tracks in a cylinder can be read without head movement.
a) What is the disk capacity?
b) What is the average access time? Assume this file is stored in
successive sectors and tracks of successive cylinders, starting at
sector 0, track 0, of cylinder i.
c) Estimate the time required to transfer a 5-MB file.
d) What is the burst transfer rate?
2. Consider a single-platter disk with the following parameters: rotation
speed: 7200 rpm; number of tracks on one side of platter: 30,000; number
of sectors per track: 600; seek time: one ms for every hundred tracks
traversed. Let the disk receive a request to access a random sector on a
random track and assume the disk head starts at track 0.
a) What is the average seek time?
b) What is the average rotational latency?
c) What is the transfer time for a sector?
d) What is the total average time to satisfy a request?
3. It should be clear that disk striping can improve data transfer rate when the
strip size is small compared to the I/O request size. It should also be clear
that RAID 0 provides improved performance relative to a single large disk,
because multiple I/O requests can be handled in parallel. However, in this
latter case, is disk striping necessary? That is, does disk striping improve
I/O request rate performance compared to a comparable disk array without
striping?
Page 20 of 20