• 沒有找到結果。

a. Would any of the scheduling algorithms discussed in this chapter

Mass Storage Structure

Exercises 85 a. Would any of the scheduling algorithms discussed in this chapter

be particularly good for this case? Explain your answer.

b. Propose a disk-scheduling algorithm that gives even better per-formance by taking advantage of this “hot spot” on the disk.

c. File systems typically find data blocks via an indirection table, such as a FAT inDOSor inodes in UNIX. Describe one or more ways to take advantage of this indirection to improve the disk performance.

Answer:

a. SSTFwould take greatest advantage of the situation.FCFScould cause unnecessary head movement if references to the “high-demand” cylinders were interspersed with references to cylin-ders far away.

b. Here are some ideas. Place the hot data near the middle of the disk. ModifySSTFto prevent starvation. Add the policy that if the disk becomes idle for more than, say, 50 ms, the operating system generates an anticipatory seek to the hot region, since the next request is more likely to be there.

c. Cache the metadata in primary memory, and locate a file’s data and metadata in close physical proximity on the disk. (UNIX accomplishes the latter goal by allocating data and metadata in regions called cylinder groups.)

12.8 Could aRAIDLevel 1 organization achieve better performance for read requests than aRAIDLevel 0 organization (with nonredundant striping of data)? If so, how?

Answer: Yes, aRAIDLevel 1 organization could achieve better perfor-mance for read requests. When a read operation is performed, aRAID Level 1 system can decide which of the two copies of the block should be accessed to satisfy the request. This choice could be based on the current location of the disk head and could therefore result in perfor-mance optimizations by choosing a disk head which is closer to the target data.

12.9 Consider aRAIDLevel 5 organization comprising five disks, with the parity for sets of four blocks on four disks stored on the fifth disk. How many blocks are accessed in order to perform the following?

a. A write of one block of data

b. A write of seven continuous blocks of data

Answer: 1) A write of one block of data requires the following: read of the parity block, read of the old data stored in the target block, computation of the new parity based on the differences between the new and old contents of the target block, and the write of the parity block and the target block. 2) Assume that the seven contiguous blocks begin at a four-block boundary. A write of seven contiguous blocks of data could be performed by writing the seven contiguous blocks,

writing the parity block of the first four blocks, reading the eight block, computing the parity for the next set of four blocks and writing the corresponding parity block onto disk.

12.10 Compare the throughput achieved by aRAIDLevel 5 organization with that achieved by aRAIDLevel 1 organization for the following:

a. Read operations on single blocks

b. Read operations on multiple contiguous blocks

Answer: 1) The amount of throughput depends on the number of disks in the RAID system. ARAIDLevel 5 comprising of a parity block for every set of four blocks spread over five disks can support four to five operations simultaneously. ARAID Level 1 comprising of two disks can support two simultaneous operations. Of course, there is greater flexibility inRAIDLevel 1 as to which copy of a block could be accessed and that could provide performance benefits by taking into account position of disk head. 2)RAID Level 5 organization achieves greater bandwidth for accesses to multiple contiguous blocks since the adjacent blocks could be simultaneously accessed. Such bandwidth improvements are not possible inRAIDLevel 1.

12.11 Compare the performance of write operations achieved by aRAIDLevel 5 organization with that achieved by aRAIDLevel 1 organization.

Answer: RAID Level 1 organization can perform writes by simply issuing the writes to mirrored data concurrently.RAIDLevel 5, on the other hand, would require the old contents of the parity block to be read before it is updated based on the new contents of the target block.

This results in more overhead for the write operations on aRAIDLevel 5 system.

12.12 Assume that you have a mixed configuration comprising disks orga-nized asRAIDLevel 1 and asRAIDLevel 5 disks. Assume that the system has flexibility in deciding which disk organization to use for storing a particular file. Which files should be stored in theRAIDLevel 1 disks and which in theRAIDLevel 5 disks in order to optimize performance?

Answer: Frequently updated data need to be stored onRAID Level 1 disks while data which is more frequently read as opposed to being written should be stored inRAIDLevel 5 disks.

12.13 Is there any way to implement truly stable storage? Explain your an-swer.

Answer: Truly stable storage would never lose data. The fundamental technique for stable storage is to maintain multiple copies of the data, so that if one copy is destroyed, some other copy is still available for use. But for any scheme, we can imagine a large enough disaster that all copies are destroyed.

12.14 The reliability of a hard-disk drive is typically described in terms of a quantity called mean time between failures (MTBF). Although this quantity is called a “time,” the MTBFactually is measured in drive-hours per failure.

Exercises 87 a. If a disk farm contains 1000 drives, each of which has a 750,000 hour MTBF, which of the following best describes how often a drive failure will occur in that disk farm: once per thousand years, once per century, once per decade, once per year, once per month, once per week, once per day, once per hour, once per minute, or once per second?

b. Mortality statistics indicate that, on the average, a U.S. resident has about 1 chance in 1000 of dying between ages 20 and 21 years.

Deduce theMTBFhours for 20 year olds. Convert this figure from hours to years. What does thisMTBFtell you about the expected lifetime of a 20 year old?

c. The manufacturer claims a 1-million hour MTBF for a certain model of disk drive. What can you say about the number of years that one of those drives can be expected to last?

Answer:

a. 750,000 drive-hours per failure divided by 1000 drives gives 750 hours per failure—about 31 days or once per month.

b. The human-hours per failure is 8760 (hours in a year) divided by 0.001 failure, giving a value of 8,760,000 “hours” for theMTBF. 8760,000 hours equals 1000 years. This tells us nothing about the expected lifetime of a person of age 20.

c. TheMTBFtells nothing about the expected lifetime. Hard disk drives are generally designed to have a lifetime of 5 years. If such a drive truly has a million-hourMTBF, it is very unlikely that the drive will fail during its expected lifetime.

12.15 Discuss the relative advantages and disadvantages of sector sparing and sector slipping.

Answer:

Sector sparing can cause an extra track switch and rotational latency, causing an unlucky request to require an extra 8 ms of time. Sector slipping has less impact during future reading, but at sector remapping time it can require the reading and writing of an entire track’s worth of data to slip the sectors past the bad spot.

12.16 Discuss the reasons why the operating system might require accurate information on how blocks are stored on a disk. How could the oper-ating system improve file system performance with this knowledge?

Answer: While allocating blocks for a file, the operating system could allocate blocks that are geometrically close by on the disk if it had more information regarding the physical location of the blocks on the disk.

In particular, it could allocate a block of data and then allocate the second block of data in the same cylinder but on a different surface at a rotationally optimal place so that the access to the next block could be made with minimal cost.

12.17 The operating system generally treats removable disks as shared file systems but assigns a tape drive to only one application at a time.

Give three reasons that could explain this difference in treatment of disks and tapes. Describe additional features that would be required of the operating system to support shared file-system access to a tape jukebox. Would the applications sharing the tape jukebox need any special properties, or could they use the files as though the files were disk-resident? Explain your answer.

Answer:

a. Disks have fast random-access times, so they give good perfor-mance for interleaved access streams. By contrast, tapes have high positioning times. Consequently, if two users attempt to share a tape drive for reading, the drive will spend most of its time switching tapes and positioning to the desired data, and rel-atively little time performing data transfers. This performance problem is similar to the thrashing of a virtual memory system that has insufficient physical memory.

b. Tape cartridges are removable. The owner of the data may wish to store the cartridge off-site (far away from the computer) to keep a copy of the data safe from a fire at the location of the computer.

c. Tape cartridges are often used to send large volumes of data from a producer of data to the consumer. Such a tape cartridge is reserved for that particular data transfer and cannot be used for general-purpose shared storage space.

To support shared file-system access to a tape jukebox, the operating system would need to perform the usual file-system duties, including

• Manage a file-system name space over the collection of tapes

• Perform space allocation

• Schedule theI/Ooperations

The applications that access a tape-resident file system would need to be tolerant of lengthy delays. For improved performance, it would be desirable for the applications to be able to disclose a large number of I/Ooperations so that the tape-scheduling algorithms could generate efficient schedules.

12.18 What would be the effect on cost and performance if tape storage were to achieve the same areal density as disk storage? (Areal density is the number of gigabits per square inch.)

Answer: To achieve the same areal density as a magnetic disk, the areal density of a tape would need to improve by two orders of magnitude.

This would cause tape storage to be much cheaper than disk storage.

The storage capacity of a tape would increase to more than 1 terabyte, which could enable a single tape to replace a jukebox of tapes in today’s technology, further reducing the cost. The areal density has no direct bearing on the data transfer rate, but the higher capacity per tape might reduce the overhead of tape switching.

Exercises 89