Computer Organization and Design - Chapter 6 - Book solutions - 4th edition - Hennessy, Patterson

Exercise 6.1
 Figure 6.2 describes numerous I/O devices in terms of their behavior, partner, and data rate. However, these classifications often do not provide a complete picture of data flow within a system. Explore device classifications for the following devices.
a. Auto Pilot
 b. Automated Thermostat

6.1.1 [5] <6.1> For the devices listed in the table, identify I/O interfaces and  classify them in terms of their behavior and partner.


6.1.2 [5] <6.1> For the interfaces identified in the previous problem, estimate their data rate.


6.1.3 [5] <6.1> For the interfaces identified in the previous problem, determine whether data rate or operation rate is the best performance measurement.



Exercise 6.2
Mean Time Between Failures (MTBF), Mean Time To Replacement (MTTR), and Mean Time To Failure (MTTF) are useful metrics for evaluating the reliability and availability of a storage resource. Explore these concepts by answering the questions about devices with the following metrics.







6.2.1 [5] <6.1, 6.2> Calculate the MTBF for each of the devices in the table.


6.2.2 [5] <6.1, 6.2> Calculate the availability for each of the devices in the table.


6.2.3 [5] <6.1, 6.2> What happens to availability as the MTTR approaches 0? Is this a realistic situation?
 
 
6.2.4 [5] <6.1, 6.2> What happens to availability as the MTTR gets very high, i.e., a device is difficult to repair? Does this imply the device has low availability?
 


Exercise 6.3
Average and minimum times for reading and writing to storage devices are  common measurements used to compare devices. Using techniques from Chapter 6, calculate values related to read and write time for disks with the following  characteristics.



6.3.1 [10] <6.2, 6.3> Calculate the average time to read or write a 1024­byte  sector for each disk listed in the table.


6.3.2 [10] <6.2, 6.3> Calculate the minimum time to read or write a 2048­byte sector for each disk listed in the table.


6.3.3 [10] <6.2, 6.3> For each disk in the table, determine the dominant factor for performance. Specifically, if you could make an improvement to any aspect of the disk, what would you choose? If there is no dominant factor, explain why.



Exercise 6.4
Ultimately, storage system design requires consideration of usage scenarios as well as disk parameters. Different situations require different metrics. Let’s try to systematically evaluate disk systems. Explore differences in how storage systems should be evaluated by answering the questions about the following applications.
a. Aircraft Control System
b. Phone Switch


6.4.1 [5] <6.2, 6.3> For each application, would decreasing the sector size during reads and writes improve performance? Explain your answer.


6.4.2 [5] <6.2, 6.3> For each application, would increasing disk rotation speed improve performance? Explain your answer.


6.4.3 [5] <6.2, 6.3> For each application, would increasing disk rotation speed improve system performance given that MTTF is decreased? Explain your answer.



Exercise 6.5
FLASH memory is one of the first true competitors for traditional disk drives. Explore the implications of FLASH memory by answering questions about the  following applications.
a. Aircraft Control System
b. Phone Switch

6.5.1 [5] <6.2, 6.3, 6.4> As we move towards solid state drives constructed from FLASH memory, what will change about disk read times assuming that the data transfer rate stays constant?


6.5.2 [10] <6.2, 6.3, 6.4> Would each application benefit from a solid state FLASH drive given that cost is a design factor?


6.5.3 [10] <6.2, 6.3, 6.4> Would each application be inappropriate for a solid state FLASH drive given that cost is NOT a design factor?



Exercise 6.6
Explore the nature of FLASH memory by answering the questions related to performance for FLASH memories with the following characteristics.


6.6.1 [10] <6.2, 6.3, 6.4> Calculate the average time to read or write a 1024­byte sector for each FLASH memory listed in the table.


6.6.2 [10] <6.2, 6.3, 6.4> Calculate the minimum time to read or write a 512­byte sector for each FLASH memory listed in the table.


6.6.3 [5] <6.2, 6.3, 6.4> Figure 6.6 shows that FLASH memory read and write access times increase as FLASH memory gets larger. Is this unexpected? What factors cause this?
 


Exercise 6.7
I/O can be performed either synchronously or asynchronously. Explore the differences by answering performance questions about the following peripherals.
a. Printer
b. Scanner

6.7.1 [5] <6.5> What would be the most appropriate bus type (synchronous or asynchronous) for handling communications between a CPU and the peripherals listed in the table?


6.7.2 [5] <6.5> What problems would long, synchronous busses cause for connections between a CPU and the peripherals listed in the table?


6.7.3 [5] <6.5> What problems would asynchronous busses cause for connections between a CPU and the peripherals listed in the table?



Exercise 6.8
Among the most common bus types used in practice today are FireWire (IEEE 1394), USB, PCI, and SATA. Although all four are asynchronous, they are implemented in different ways giving them different characteristics. Explore different bus structures by answering questions about the busses and the following peripherals.
a. Mouse
b. Graphics Coprocessor

6.8.1 [5] <6.5> Select an appropriate bus (FireWire, USB, PCI, or SATA) for the peripherals listed in the table. Explain why the bus selected is appropriate. (See Figure 6.8 for key characteristics of each bus.)


6.8.2 [20] <6.5> Use online or library resources and summarize the communication structure for each bus type. Identify what the bus controller does and where the control physically is.


6.8.3 [15] <6.5> Outline limitations of each of the bus types. Explain why those limitations must be taken into consideration when using the bus.




Exercise 6.9
Communicating with I/O devices is achieved using combinations of polling, interrupt handling, memory mapping, and special I/O commands. Answer the  questions about communicating with I/O subsystems for the following applications using combinations of these techniques.
a. Auto Pilot
b. Automated Thermostat

6.9.1 [5] <6.6> Describe device polling. Would each application in the table be appropriate for communication using polling techniques? Explain.


6.9.2 [5] <6.6> Describe interrupt driven communication. For each application in the table, if polling is inappropriate, explain how interrupt driven techniques could be used.


6.9.3 [10] <6.6> For the applications listed in the table, outline a design for memory mapped communication. Identify reserved memory locations and outline their contents.


6.9.4 [10] <6.6> For the applications listed in the table, outline a design for commands implementing command driven communication. Identify commands and their interaction with the device.


6.9.5 [5] <6.6> Does it make sense to define I/O subsystems that use a combination of memory mapping and command driven communication? Explain your answer.




Exercise 6.10
Section 6.6 defines an eight­step process for handling interrupts. The Cause and Status registers together provide information on the cause of the interrupt and the status of the interrupt handling system. Explore interrupt handling by answering the questions about the following combinations of interrupts.
a. Ethernet Controller Data Mouse Controller Reboot
b. Mouse Controller Power Down Overheat


6.10.1 [5] <6.6> When an interrupt is detected, the Status register is saved and all but the highest priority interrupt is disabled. Why are low­priority interrupts disabled? Why is the status register saved prior to disabling interrupts?


6.10.2 [10] <6.6> Prioritize interrupts from the devices listed in each table row.


6.10.3 [10] <6.6> Outline how an interrupt from each of the devices listed in the table would be handled


6.10.4 [5] <6.6> What happens if the interrupt enable bit of the Cause register is not set when handling an interrupt? What value could the interrupt mask value take to accomplish the same thing?


6.10.5 [5] <6.6> Most interrupt handling systems are implemented in the operating system. What hardware support could be added to make interrupt handling more efficient? Contrast your solution to potential hardware support for function calls.


6.10.6 [5] <6.6> In some interrupt handling implementations, an interrupt causes an immediate jump to an interrupt vector. Instead of a Cause register where each interrupt sets a bit, each interrupt has its own interrupt vector. Can the same priority interrupt system be implemented using this approach? Is there any advantage to this approach?



Exercise 6.11
Direct Memory Access (DMA) allows devices to access memory directly rather than working through the CPU. This can dramatically speed up the performance of peripherals, but adds complexity to memory system implementations. Explore DMA implications by answering the questions about the following peripherals.
a. Mouse Controller
b. Ethernet Controller

6.11.1 [5] <6.6> Does the CPU relinquish control of memory when DMA is active? For example, can a peripheral simply communicate with memory directly, avoiding the CPU completely?


6.11.2 [10] <6.6> Of the peripherals listed in the table, which would benefit from DMA? What criteria determine if DMA is appropriate?


6.11.3 [10] <6.6> Of the peripherals listed in the table, which could cause coherency problems with cache contents? What criteria determine if coherency issues must be addressed?


6.11.4 [5] <6.6> Describe what problems could occur when mixing DMA and virtual memory. Which of the peripherals in the table could introduce such problems? How can they be avoided?
 



Exercise 6.12
Metrics for I/O performance may vary dramatically from application to application. Where the number of transactions processed dominates performance in some situations, data throughput dominates in others. Explore I/O performance evaluation by answering the questions for the following applications.
a. Mathematical Computations
b. Online Chat


6.12.1 [10] <6.7> For each application in the table, does I/O performance dominate system performance?


6.12.2 [10] <6.7> For each application in the table, is I/O performance best measured using raw data throughput?


6.12.3 [5] <6.7> For each application in the table, is I/O performance best measured using the number of transactions processed?


6.12.4 [5] <6.7> Is there a relationship between the performance measures from the previous two problems and choosing whether to use polling or interrupt driven communication? What about the choice of using memory mapped or command driven I/O?
 



Exercise 6.13
Benchmarks play an important role in evaluating and selecting peripheral devices. For benchmarks to be useful, they must exhibit properties similar to those experienced by a device under normal use. Explore benchmarks and device selection by answering questions about the following applications.
a. Mathematical Computations
b. Online Chat


6.13.1 [5] <6.7> For each application in the table, define characteristics that a set of benchmarks should exhibit when evaluating an I/O subsystem.


6.13.2 [15] <6.7> Using online or library resources, identify a set of standard benchmarks for applications in the table. Why do standard benchmarks help?


6.13.3 [5] <6.7> Does it make sense to evaluate an I/O subsystem outside the larger system it is a part of? How about evaluating a CPU?
 



Exercise 6.14
RAID is among the most popular approaches to parallelism and redundancy in storage systems. The name Redundant Arrays of Inexpensive Disks implies  several things about RAID arrays that we will explore in the context of the following  activities.
a. High-Performance Mathematical Computations
b. Online Video Services

6.14.1 [10] <6.9> RAID 0 uses striping to force parallel access among many disks. Why does striping improve disk performance? For each of the activities listed in the table, will striping help better achieve their goals?


6.14.2 [5] <6.9> RAID 1 mirrors data among several disks. Assuming that inexpensive disks have lower MTBF than expensive disks, how can redundancy using inexpensive disks result in a system with lower MTBF? Use the mathematical definition of MTBF to explain your answer. For each of the activities listed in the table, will RAID 1 help better achieve their goals?


6.14.3 [5] <6.9> Like RAID 1, RAID 3 provides higher data availability. Explain the trade­off between RAID 1 and RAID 3. Would each of the applications listed in the table benefit from RAID 3 over RAID 1?



Exercise 6.15
RAID 3, RAID 4, and RAID 5 all use parity system to protect blocks of data.  Specifically, a parity block is associated with a collection of data blocks. Each row in the following table shows the values of the data and parity blocks, as described in Figure 6.13.



6.15.1 [10] <6.9> Calculate the new RAID 3 parity value P’ for data in lines a and b in the table.


6.15.2 [10] <6.9> Calculate the new RAID 4 parity value P’ for data in lines a and b in the table.


6.15.3 [5] <6.9> Is RAID 3 or RAID 4 more efficient? Are there reasons why RAID 3 would be preferable to RAID 4?


6.15.4 [5] <6.9> RAID 4 and RAID 5 use roughly the same mechanism to calculate and store parity for data blocks. How does RAID 5 differ from RAID 4 and for what applications would RAID 5 be more efficient?


6.15.5 [5] <6.9> RAID 4 and RAID 5 speed improvements grow with respect to RAID 3 as the size of the protected block grows. Why is this the case? Is there a situation where RAID 4 and RAID 5 would be no more efficient than RAID 3?



Exercise 6.16
The emergence of web servers for ecommerce, online storage, and communication has made disk servers critical applications. Availability and speed are well­known metrics for disk servers, but power consumption is becoming increasingly important. Answer the questions about configuration and evaluation of disk servers with the following parameters.


6.16.1 [10] <6.8, 6.10> Find the maximum sustained I/O rate for random reads and writes. Ignore disk conflicts and assume the RAID controller is not the bottleneck. Follow the same approach as outlined in Section 6.10 making similar assumptions where necessary.


6.16.2 [10] <6.8, 6.10> Assume we are configuring a Sun Fire x4150 server as described in Section
 6.10. Determine if a configuration of 8 disks presents an I/O bottleneck. Repeat for configurations of 16, 4, and 2 disks.


6.16.3 [10] <6.8, 6.10> Determine if the PCI bus, DIMM, or the Front Side Bus presents an I/O bottleneck. Use the same parameters and assumptions used in Section 6.10.


6.16.4 [5] <6.8, 6.10> Explain why real systems tend to use benchmarks or real applications to assess actual performance.



Exercise 6.17
Determining the performance of a single server with relatively complete data is an easy task. However, when comparing servers from different vendors providing different data, choosing among alternatives can be difficult. Explore the process of finding and evaluating servers by answering questions about the following application.
Database Server

6.17.1 [15] <6.8, 6.10> For the application listed above, identify runtime characteristics for an operational system. Choose characteristics that will support evaluation similar to that performed for Exercise 6.16



6.17.2 [15] <6.8, 6.10> For the application listed above, find a server available in the marketplace that you feel would be appropriate for running the application. Before evaluating the server, identify reasons why it was selected.


6.17.3 [20] <6.8, 6.10> Using metrics similar to those used in Chapter 6 and Exercise 6.16, assess the server you identified in 6.17.2 in comparison to the Sun Fire x4150 server evaluated in Exercise 6.16. Which would you choose? Did the results of your analysis surprise you? Specifically, would you choose differently?


6.17.4 [15] <6.8, 6.10> Identify a standard benchmark set that would be useful for comparing the server you identified in 6.17.2 with the Sun Fire x4150.



Exercise 6.18
Measurements and statistics provided by storage vendors must be carefully interpreted to gain meaningful predictions about their system behavior. The following table provides data for various disk drives.



6.18.1 [10] <6.12> Calculate annual failure rate (AFR) for disks in the table.


6.18.2 [10] <6.12> Assume that annual failure rate varies over the lifetime of disks in the previous table. Specifically, assume that AFR is three times as high in the 1st month of operation and doubles every year starting in the 5th year. How many disks would be replaced after 7 years of operation? What about 10 years?


6.18.3 [10] <6.12> Assume that disks with lower failure rates are more expensive. Specifically, disks are available at a higher cost that will start doubling their failure rate in year 8 rather than year 5. How much more would you pay for disks if your intent is to keep them for 7 years? What about 10 years?



Exercise 6.19
For disks in the table in Exercise 6.18, assume that your vendor offers a RAID 0 configuration that will increase storage system throughput by 70% and a RAID 1 configuration that will drop AFR of disk pairs by 2. Assume that the cost of each solution is 1.6 times the original solution cost. 6.19.1 [5] <6.9, 6.12> Given only the original problem parameters, would you recommend upgrading to either RAID 0 or RAID 1 assuming individual disk parameters remain the same in the previous table?


6.19.2 [5] <6.9, 6.12> Given that your company operates a global search engine with a large disk farm, does upgrading to either RAID 0 or RAID 1 make economic sense given that your income model is based on the number of advertisements served?


6.19.3 [5] <6.9, 6.12> Repeat 6.19.2 for a large disk farm operated by an online backup company. Does upgrading to either RAID 0 or RAID 1 make economic sense given that your income model is based on the availability of your server?



Exercise 6.20
Day­to­day evaluation and maintenance of operational computer systems involves many of the concepts discussed in Chapter 6. Explore the intricacies of evaluating systems by exploring the following questions.

6.20.1 [20] <6.10, 6.12> Configure the Sun Fire x4150 to provide 10 terabytes of storage for a processor array of 1000 processors running bioinformatics simulations. Your configuration should minimize power consumption while addressing throughput and availability concerns for the disk array. Make sure you consider the properties of large simulations when performing your configuration.


6.20.2 [20] <6.10, 6.12> Recommend a backup and data archiving system for the disk array from
 6.20.1. Compare and contrast disk, tape, and online backup capabilities. Use Internet and library resources to identify potential servers. Assess cost and suitability for the application using parameters described in Chapter 6. Select parameters for comparison using properties of the application as well as specified requirements.


6.20.3 [15] <6.10, 6.12> Competing vendors for the systems you identified in 6.20.2 have offered to allow you to evaluate their systems on site. Identify the benchmarks you will use to determine which system is best for your application. Determine how long it will take you to gather enough data to make your determination.