Chapter 5: Q15E (page 494)
One of the biggest impediments to widespread use of virtual machines is the performance overhead incurred by running a virtual machine. Listed below are various performance parameters and application behavior.
Base CPI | Priviliged O/S Accesses per 10,000 Instructions | Performance Impact to Trap to the Guest O/S | Performance Impact to Trap to VMM | I/O Access per 10,000 Instructions | I/O Access Time (Includes Time to Trap to Guest O/S) |
1.5 | 120 | 15 cycles | 175 cycles | 30 | 1100 cycles |
(5.15.1) Calculate the CPI for the system listed above assuming that there are no accesses to I/O. What is the CPI if the VMM performance impact doubles? If it is cut in half? If a virtual machine software company wishes to obtain a 10% performance degradation, what is the longest possible penalty to trap to the VMM?
(5.15.2) I/O accesses often have a large impact on overall system performance. Calculate the CPI of a machine using the performance characteristics above, assuming a non-virtualized system. Calculate the CPI again, this time using a virtualized system. How do these CPIs change if the system has the I/O access? Explain why I/O bound applications have a smaller impact from virtualization.
(5.15.3) Compare and contrast the ideas of virtual memory and virtual machines. How do the goals of each compare? What are the pros and cons of each? List a few cases where virtual memory is desired, and a few cases where virtual machines are desired.
(5.15.4) Section 5.6 discusses virtualization under the assumption that the virtualized system is running the same ISA as the underlying hardware. However, one possible used of virtualization is to emulate non-native ISAs. An example of this is QEMU, which emulates a variety of ISAs such as MIPS, SPARC, and PowerPC. What are some of the difficulties involved in this kind of virtualization? Is it possible for an emulated system to run faster than on its native ISA?
Short Answer
(5.15.1)
The CPI of the system is 3.78. The CPI if VMM performance doubles are 5.88 and if halves are 2.73. The longest possible penalty to trap is 14 cycles.
(5.15.2)
The CPI for a non-virtualized system is 4.8. The CPI for the virtualized system is 7.605. The CPI for a virtualized system with half I/O access is 5.69. The impact of virtualization on I/O bound applications is less because longer time is spent waiting for I/O accesses to complete.
(5.15.3)
Virtual memory gives an illusion of address space and the virtual machine gives an illusion of having dedicated physical hardware.
(5.15.4)
It is difficult to emulate each instruction for the target ISA. An emulated system can run faster than on its native ISA.