[go: up one dir, main page]

0% found this document useful (0 votes)
102 views20 pages

Gs Orakom - m5

This document discusses external memory devices, focusing on magnetic disks and RAID systems. It provides details on how magnetic disks work, including their read/write mechanisms, data formatting, physical characteristics, and performance parameters such as seek time and rotational delay. It then examines RAID systems, describing the seven RAID levels and how they distribute data across disks using striping and redundancy to provide data recoverability and improved performance or reliability compared to a single disk.

Uploaded by

ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views20 pages

Gs Orakom - m5

This document discusses external memory devices, focusing on magnetic disks and RAID systems. It provides details on how magnetic disks work, including their read/write mechanisms, data formatting, physical characteristics, and performance parameters such as seek time and rotational delay. It then examines RAID systems, describing the seven RAID levels and how they distribute data across disks using striping and redundancy to provide data recoverability and improved performance or reliability compared to a single disk.

Uploaded by

ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

7097 – NIZIRWAN ANWAR

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).

5.2 MAGNETIC DISK

A disk is a circular platter constructed of nonmagnetic material, called the substrate,


coated with a magnetizable material. Traditionally, the substrate has been an
aluminum or aluminum alloy material. More recently, glass substrates have been
introduced. The glass substrate has a number of benefits, including the following:

Improvement in the uniformity of the magnetic film surface to increase disk


reliability.
A significant reduction in overall surface defects to help reduce read-write
errors.
Ability to support lower fly heights (described subsequently).
Better stiffness to reduce disk dynamics.
Greater ability to withstand shock and damage.

5.2.1 Magnetic Read and Write Mechanisms

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.

Figure 5.1 Inductive Write/Magnetoresistive Read Head

5.2.2 Data Organization and Formatting

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

Figure 6.2 Disk Data Layout

5.2.3 Physical Characteristics

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.

Table 6.1 Physical Characteristics of Disk Systems

Table 6.2 Typical Hard Disk Drive Parameters

5.2.4 Disk Performance Parameters

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.

Figure 5.4 Timing of a Disk I/O Transfer

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

typical disk was 14 inches (36 cm) in diameter, whereas the


most common size today is 3.5 inches (8.9 cm), reducing the
distance that the arm has to travel. A typical average seek
time on contemporary hard disks is under 10 ms.
Rotational Delay Disks, other than floppy disks, rotate at speeds ranging from
3600 rpm (for handheld devices such as digital cameras) up
to, as of this writing, 20,000 rpm; at this latter speed, there is
one revolution per 3 ms. Thus, on the average, the rotational
delay will be 1.5 ms.
Transfer Time. The transfer time to or from the disk depends on the rotation
speed of the disk in the following fashion.

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

wish to read a file consisting of 2500 sectors for a total of


1.28 Mbytes.
5.3 RAID

Fortunately, industry has agreed on a standardized scheme for multiple-disk


database design, known as RAID (Redundant Array of Independent Disks). The
RAID scheme consists of seven levels, zero through six. These levels do not imply a
hierarchical relationship but designate different design architectures that share three
common characteristics:

[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.

Table 5.1 RAID Levels a Comparative

Note: N = number of data disks; m proportional to log N

Page 7 of 20
7097 – NIZIRWAN ANWAR

5.3.1 RAID Level 0

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.

Figure 5.5 RAID 0 (Nonredundant)

Page 8 of 20
7097 – NIZIRWAN ANWAR

Figure 5.6 Data Mapping for a RAID Level 0 Array


Figure 5.6 above indicates the use of array management software to map between
logical and physical disk space. This software may execute either in the disk
subsystem or in a host computer.

5.3.2 RAID Level 1

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.

Figure 5.7 RAID 1 (Mirrored)

5.3.2 RAID Level 2

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.

Figure 5.8 RAID 2 (Redundancy through Hamming code)

5.3.3 RAID Level 3

RAID 3 is organized in a similar fashion to RAID 2. The difference is that RAID 3


requires only a single redundant disk, no matter how large the disk array. RAID 3
employs parallel access, with data distributed in small strips. Instead of an
errorcorrecting code, a simple parity bit is computed for the set of individual bits in
the same position on all of the data disks.

Figure 5.8 RAID 3 (Bit-interleaved parity)

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:

X4(i) = X3(i) ⊕ X2(i) ⊕ X1(i) ⊕ X0(i)

where ⊕ is exclusive-OR function. Suppose that drive X1 has


failed, if we add X4(i) ⊕ X1(i) to both sides of the preceding
equation, we get

X1(i) = X4(i) ⊕ X3(i) ⊕ X2(i) ⊕ X0(i)

Thus, the contents of each strip of data on X1 can be regenerated


from the contents of the corresponding strips on the remaining disks
in the array. This principle is true for RAID levels 3 through 6.

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.

5.3.4 RAID Level 4

RAID levels 4 through 6 make use of an independent access technique. In an


independent access array, each member disk operates independently, so that
separate I/O requests can be satisfied in parallel. Because of this, independent
access arrays are more suitable for applications that require high I/O request rates
and are relatively less suited for applications that require high data transfer rates.
RAID 4 involves a write penalty when an I/O write request of small size is performed.
Each time that a write occurs, the array management software must update not only

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:

X4(i) = X3(i) ⊕ X2(i) ⊕ X1(i) ⊕ X0(i)

After the update, with potentially altered bits indicated by a prime symbol:

X4′(i) = X3(i) ⊕ X2(i) ⊕ X1′(i)X0(i)


= X3(i) ⊕ X2(i) ⊕ X1′(i) ⊕ X0(i) ⊕ X1(i) ⊕ X1(i)
= X3(i) ⊕ X2(i) ⊕ X1(i) ⊕ X0(i) ⊕ X1(i) ⊕ X1′(i)
= X4(i) ⊕ X1(i) ⊕ X1′(i)

Figure 5.9 RAID 4 (Block-level parity)

5.3.4 RAID Level 5

RAID 5 is organized in a similar fashion to RAID 4. The difference is that RAID 5


distributes the parity strips across all disks. A typical allocation is a round-robin
scheme, as illustrated in Figure 6.6f. For an n-disk array, the parity strip is on a
different disk for the first n stripes, and the pattern then repeats. The distribution of
parity strips across all drives avoids the potential I/O bottle-neck found in RAID 4.

Page 12 of 20
7097 – NIZIRWAN ANWAR

Figure 5.10 RAID 5 (Block-level distributed parity)

5.3.4 RAID Level 6

RAID 6 was introduced in a subsequent paper by the Berkeley researchers


[KATZ89]. In the RAID 6 scheme, two different parity calculations are carried out and
stored in separate blocks on different disks. Thus, a RAID 6 array whose user data
require N disks consists of N + 2 disks. Figure 5.11 illustrates the scheme. P and Q
are two different data check algorithms. One of the two is the exclusive-OR
calculation used in RAID 4 and 5. But the other is an independent data check
algorithm. This makes it possible to regenerate data even if two disks containing
user data fail.

Figure 5.11 RAID 6 (Dual redundancy)

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

compared with a RAID 5 implementation. RAID 5 and RAID 6 read performance is


comparable ( see and read table 5.1)

5.4 SOLID STATE DRIVES

One of the most significant developments in computer architecture in recent years is


the increasing use of solid state drives (SSDs) to complement or even replace hard
disk drives (HDDs), both as internal and external secondary memory. The term solid
state refers to electronic circuitry built with semiconductors. An SSD is a memory
device made with solid state components that can be used as a replacement to a
hard disk drive.
Table 5.2 RAID Comparison at Vulnerabilty

Page 14 of 20
7097 – NIZIRWAN ANWAR

5.4.1 SSD Compared to HDD

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.

5.4.2 SSD Organization

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.

Table 5.3 Comparison of Solid State Drives and Disk Drives

Page 15 of 20
7097 – NIZIRWAN ANWAR

In addition to the interface to the host system, the SSD contains the following
components:

Controller  Provides SSD device level interfacing and firmware


execution.
Addressing  Logic that performs the selection function across the flash
memory components.
Data buffer/cache  High speed RAM memory components used for
speed matching and to increased data throughput.
Error correction  Logic for error detection and correction.
Flash memory components  Individual NAND flash chips.

Page 16 of 20
7097 – NIZIRWAN ANWAR

Figure 5.12 Solid State Drive Architecture

5.5 OPTICAL MEMORY

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

Figure 5.13 CD Operation

Table 5.4 Optical Disk Products

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:

Sync  The sync field identifies the beginning of a block. It consists of a


byte of all 0s, 10 bytes of all 1s, and a byte of all 0s.

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.

Figure 5.14 CD-ROM Block Format

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

You might also like