1. Field of the Invention
This invention relates to virtual machines of a computer processor such as a microprocessor. In particular, the invention relates to a virtual machine manager that may bind virtual machines to hardware contexts of a processor in a computer or other computing device.
2. Background
An Operating System (OS) is a software program that controls physical computer hardware (e.g., a processor, memory, and disk and CD-ROM drives) and presents application programs with a unified set of abstract services (e.g., a file system). A Virtual Machine Manager (VMM) is also a software program that controls physical computer hardware such as, for example, the processor, memory, and disk drives. Unlike an OS a VMM presents programs executing within a Virtual Machine (VM) with the illusion that they are executing on real physical computer hardware that includes, for example, a processor, memory and a disk drive. Each VM typically functions as a self-contained entity, such that software executing in a VM executes as if it were running alone on a “bare” machine instead of within a virtual machine that shares a processor and other physical hardware with other VMs. It is the VMM that emulates certain functions of a “bare” machine so that software executing within a VM executes as if it were the sole entity executing on the computer.
In order to accomplish this emulation it is necessary for some operations within a VM to be trapped and emulated by the VMM. The VMM may perform a sequence of operations on simulated hardware resources in order to maintain the illusion that a VM is actually interacting with real hardware. Transitions from a VM to the VMM and back will occur with some frequency, depending upon the number of tasks which the VMM must emulate for the VM. For example, a VMM must trap and emulate attempts to configure hardware devices. This may be achieved by the VMM via simulated hardware registers in system memory.
When executing “real-time” applications, computations upon data that is available at one substantially predetermined time should be completed by another substantially predetermined time. An OS that schedules a real-time application with sufficient frequency and for sufficient duration that the real-time application is able to complete its computations before their respective deadlines is said to have received adequate scheduling Quality of Service (QoS). Similarly, a VMM that includes a VM and a real-time OS (RTOS) provides adequate scheduling QoS when real-time applications and the VMs complete execution before respective deadlines. OSs and VMMs should schedule the computing resources of their real or virtual machine in such a fashion as to ensure that real-time applications receive adequate scheduling QoS.
Many current generation microprocessors such as, for example, the Intel® Pentium® 3 and 4 microprocessors include superpipelined out of order machines where instructions need not be executed in strict program order. While such processors typically have a number of independent execution units, they only fetch instructions from a single instruction stream. Some microprocessors, including some future members of the Pentium® family of processors, will have the ability to simultaneously fetch instructions from two or more instruction streams. These instruction streams are generally called threads because they correspond to threads scheduled by the system software. Microprocessors that simultaneously fetch instructions from two or more instruction streams are variously referred to as “hyper-threaded”, “multi-threaded” or “symmetric multi-threaded.” On hyper-threaded microprocessors the instruction fetch units are controlled by “hardware contexts”, which include both a stack pointer and an instruction pointer, a set of standard processor registers plus any additional state information necessary such as, for Pentium® family processors, control registers and translation look-aside buffer (TLB) tag bits. On out-of-order processors the nominal processor registers will generally be dynamically allocated from a pool of renameable registers, so that the actual static hardware context may be little more than a stack pointer, instruction pointer and a few control registers.
In many processors used in various kinds of computing devices, including personal computers, a virtual machine manager (VMM) may be implemented and used to manage multiple virtual machines (VMs) that are used to provide an environment for multiple operating systems to concurrently execute. The VMM provides emulation assistance to the VMs so that software (e.g., an operating system) in each VM believes that it has sole access to and thus control of the entire computing device. In reality, the VMM shares the resources of the computing device (e.g., the processor, memory and disk drive(s)) among the multiple VMs based on the respective requirements of the software executing in each VM and the availability and suitability of system and processor resources. Thus, there may be significant overhead incurred in switching among the various VMs. According to a method described herein, the VMM may bind certain VMs to certain hardware contexts in a hyper-threaded processor. According to the methods described herein, in certain situations, it may be beneficial to bind one or more VMs, particularly real-time VMs, to one or more hardware contexts for reasons including, but not limited to, maximizing efficiency and minimizing latency and response time.
Real-time virtual machines (RTVMs) are virtual machines that contain software applications that perform computations that must complete before a deadline or deadlines as measured according to an external reference clock (i.e., a so-called “wall clock”). Among the applications that an RTVM might contain are streaming media applications, including audio and video applications, digital signal processing and communications applications, including modem and networking applications. RTVMs may also be used in other instances. Because of the fine grained machine switch requirements placed on a virtual machine system by RTVMs, an undesirable amount of overhead may be generated when the VMM switches between various VMs and RTVMs. By binding RTVMs, and, in some instances, non-real-time VMs, to dedicated hardware contexts on a hyper-threaded processor, the overhead associated with such switching is reduced and performance of the virtual machine system is improved. Although the term “binding” is used herein, binding includes and/or is synonymous with, for example, but not limited to, assigning, aggregating, designating, allocating, distributing, or otherwise establishing and/or managing the relationship between VMs and hardware contexts.
In various embodiments, the methods described herein may be implemented as software, such as VMM software 232 stored on storage device 230. When executed by processor 210, VMM software 232 is stored as VMM 222 in memory 220. When managing real-time virtual machines, the hardware contexts and the real-time virtual machines themselves may be stored as RTVM 226 in memory 220, and may be stored in and/or swapped out to storage device 230 as RTVM 236. As shown in
In one embodiment, the software executing on personal computer 200 and in the virtual machines may have access to and communicate with users of personal computer 200 by presenting text and images via graphics controller 240 which is coupled to display 242. Similarly, a user of personal computer 200 may provide input to those programs executing as virtual machines via keyboard 252 and mouse 254 coupled to USB host controller 250.
The processor 210 represents a processing unit of any type, including embedded processors, micro-controllers, digital signal processors, superscalar computers, vector processors, single instruction multiple data (SIMD) computers, complex instruction set computers (CISC), reduced instruction set computers (RISC), very long instruction word (VLIW) computers, hybrid architecture processors, and the like. In one embodiment, the processor 210 is compatible with the 32 bit Intel Architecture (IA) processor specification, known as IA-32. In another embodiment, the processor may be compatible with other instruction sets and/or processor architectures, including the 64 bit Intel Architecture known as IA-64. For further information regarding IA-32 and IA-64 see IA-32 Intel Architecture Software Developer's Manual, rev. 2 (February 2001) and Intel IA-64 Architecture Software Developer's Manual, rev. 1.1 (July 2000) available from Intel Corporation of Santa Clara, Calif. The processor 210 may contain a number of control registers to support memory management tasks such as virtual memory and cache memory. These tasks may include paging and segmentation. In various embodiments, personal computer 200 may include two or more processors like processor 210.
The VMM evaluates the single context execution time X′ of the current virtual machine, as shown in block 414. The single context execution time X′ is a value that is smaller than the bandwidth X; X′ is also referred to as nominal execution time as it takes into account the savings implicit in executing the current virtual machine as a single hardware context. The VMM evaluates the efficiency of executing the current virtual machine as a single hardware context by evaluating X′/Y, as shown in block 416. That is, to determine the efficiency of executing the current virtual machine as a single hardware context, the maximal use of processor resources is evaluated by dividing the single context execution time by the latency of the current virtual machine. The VMM evaluates the execution footprint of the current virtual machine, as shown in block 418. In one embodiment, the footprint may be determined by evaluating the amount of memory required for executing the current virtual machine. The footprint may be used in further evaluation of the current virtual machine.
The VMM checks to determine if there are any further virtual machines on a virtual machine list to evaluate, as shown in block 420. If there are additional virtual machines to evaluate, the VMM sets the current virtual machine to be the next virtual machine, as shown in block 422. The flow of execution continues at block 410.
After all virtual machines have been evaluated by the VMM in blocks 410 through 418, when there are no additional virtual machines on a virtual machine list to evaluate, as shown in block 420, execution continues at block 430.
The VMM ranks all virtual machines on the virtual machine list based on the lowest latency, that is, the smallest Y, as shown in block 430. In one embodiment, the ranking may be on a numerical scale in which the smaller the latency, the larger the ranking. The VMM may rank all virtual machines based on the maximal use of the hardware contexts, that is, the most efficient virtual machines, namely, those machines having the largest X′/Y, as shown in block 440. In one embodiment, the ranking may be on a numerical scale in which the more efficient the VM, the larger the ranking. The latency and efficiency rankings may be assigned according to any scale. The numeral scale described is only presented as an example. Other scales, such as by letter, and by any other kind of designator may be used.
The VMM selects a group of candidates for binding to a hardware context based on the latency and/or the efficiency, as shown in block 450. In one embodiment, the group of candidates may be determined as those top group of virtual machines that are ranked highest as determined in blocks 430 and 440. In various embodiments, the group of candidates may be a group of predetermined size, such as, for example, a group of two, a group of ten, or some other number. The VMM binds each of the group of candidate real-time virtual machines to a single hardware context if the latency of the VM is less than a system specified maximum latency and the efficiency of the VM is greater than a system specified minimum efficiency, as shown in block 452. In this way, if the group of candidates do not meet system specified threshold requirements, they are not bound to the hardware contexts. In another embodiment, this binding may proceed if only one of the latency and the efficiency are within system mandated constraints. In one embodiment, both the system specified maximum latency and the system specified minimum efficiency are set based on the speed of the particular processor. The system specified maximum latency and minimum efficiency may also be influenced by on-chip cache memory size, the size of all of the data needed for a hardware context, and other processor related factors.
The VMM determines whether any virtual machines have execution periods that are multiples of each other (i.e., are harmonic) such that they may share a hardware context, as shown in block 460. VMs that have execution periods such that one VMs execution period is an integral multiple of another VM's execution period do not conflict with one another are considered harmonic and may share a hardware context if there is sufficient processor bandwidth available (i.e., given VM A and VM B, X′A/YA+X′B/YB<=1.0). If there are virtual machines that have execution periods that may share a hardware context, each group is added to a shared context candidate list, as shown in block 460. In this way, multiple virtual machines may share a single hardware context. That is, for example, if a virtual machine has a latency of once every three milliseconds, and another virtual machine has a latency of once every five milliseconds, these two virtual machines may efficiently share a single hardware context. The VMM evaluates virtual machine groups on the shared context candidate list and assigns each of one or more groups of virtual machines to single hardware contexts, as shown in block 470.
In addition, the VMM may bind groups of virtual machines having small footprints to single hardware contexts when the groups have latencies that are multiples of each other. That is, virtual machines that have latency periods that are multiples of each other may only share a hardware context when the total size of their footprints do not exceed the amount of resources available. In this way, both the resources required by a first virtual machine and a second virtual machine that share a hardware context may remain in memory, or otherwise be accessible, such that when they are alternately executed at their particular periods, no swapping or other related overhead is incurred. Other more complex sharing and scheduling schemes may be implemented.
In the foregoing specification, the invention has been described with reference to specific embodiments. It will be evident that various modifications and changes can be made thereto without departing from the broader spirit and scope of the invention as set forth in the appended claims. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense.
Number | Name | Date | Kind |
---|---|---|---|
3699532 | Schaffer et al. | Oct 1972 | A |
3996449 | Attanasio et al. | Dec 1976 | A |
4037214 | Birney et al. | Jul 1977 | A |
4162536 | Morley | Jul 1979 | A |
4207609 | Luiz et al. | Jun 1980 | A |
4247905 | Yoshida et al. | Jan 1981 | A |
4276594 | Morley | Jun 1981 | A |
4278837 | Best | Jul 1981 | A |
4307447 | Provanzano et al. | Dec 1981 | A |
4319233 | Matsuoka et al. | Mar 1982 | A |
4319323 | Ermolovich et al. | Mar 1982 | A |
4347565 | Kaneda et al. | Aug 1982 | A |
4366537 | Heller et al. | Dec 1982 | A |
4403283 | Myntti et al. | Sep 1983 | A |
4419724 | Branigin et al. | Dec 1983 | A |
4430709 | Schleupen et al. | Feb 1984 | A |
4521852 | Guttag | Jun 1985 | A |
4571672 | Hatada et al. | Feb 1986 | A |
4759064 | Chaum | Jul 1988 | A |
4787026 | Barnes et al. | Nov 1988 | A |
4795893 | Ugon | Jan 1989 | A |
4802084 | Ikegaya et al. | Jan 1989 | A |
4825052 | Chemin et al. | Apr 1989 | A |
4907270 | Hazard | Mar 1990 | A |
4907272 | Hazard | Mar 1990 | A |
4910774 | Barakat | Mar 1990 | A |
4975836 | Hirosawa et al. | Dec 1990 | A |
5007082 | Cummins | Apr 1991 | A |
5022077 | Bealkowski et al. | Jun 1991 | A |
5075842 | Lai | Dec 1991 | A |
5079737 | Hackbarth | Jan 1992 | A |
5187802 | Inoue et al. | Feb 1993 | A |
5201049 | Shorter | Apr 1993 | A |
5230069 | Brelsford et al. | Jul 1993 | A |
5233533 | Edstrom et al. | Aug 1993 | A |
5237616 | Abraham et al. | Aug 1993 | A |
5255379 | Melo | Oct 1993 | A |
5287363 | Wolf et al. | Feb 1994 | A |
5293424 | Holtey et al. | Mar 1994 | A |
5295251 | Wakui et al. | Mar 1994 | A |
5317705 | Gannon et al. | May 1994 | A |
5319760 | Mason et al. | Jun 1994 | A |
5361375 | Ogi | Nov 1994 | A |
5386552 | Garney | Jan 1995 | A |
5421006 | Jablon et al. | May 1995 | A |
5434999 | Goire et al. | Jul 1995 | A |
5437033 | Inoue et al. | Jul 1995 | A |
5442645 | Ugon et al. | Aug 1995 | A |
5455909 | Blomgren et al. | Oct 1995 | A |
5459867 | Adams et al. | Oct 1995 | A |
5459869 | Spilo | Oct 1995 | A |
5469557 | Salt et al. | Nov 1995 | A |
5473692 | Davis | Dec 1995 | A |
5479509 | Ugon | Dec 1995 | A |
5504922 | Seki et al. | Apr 1996 | A |
5506975 | Onodera | Apr 1996 | A |
5511217 | Nakajima et al. | Apr 1996 | A |
5522075 | Robinson et al. | May 1996 | A |
5528231 | Patarin | Jun 1996 | A |
5530860 | Matsuura | Jun 1996 | A |
5533126 | Hazard et al. | Jul 1996 | A |
5555385 | Osisek | Sep 1996 | A |
5555414 | Hough et al. | Sep 1996 | A |
5560013 | Scalzi et al. | Sep 1996 | A |
5564040 | Kubals | Oct 1996 | A |
5566323 | Ugon | Oct 1996 | A |
5568552 | Davis | Oct 1996 | A |
5572694 | Uchino | Nov 1996 | A |
5574936 | Ryba et al. | Nov 1996 | A |
5582717 | Di Santo | Dec 1996 | A |
5604805 | Brands | Feb 1997 | A |
5606617 | Brands | Feb 1997 | A |
5615263 | Takahashi | Mar 1997 | A |
5628022 | Ueno et al. | May 1997 | A |
5633929 | Kaliski, Jr. | May 1997 | A |
5657445 | Pearce | Aug 1997 | A |
5668971 | Neufeld | Sep 1997 | A |
5684948 | Johnson et al. | Nov 1997 | A |
5706469 | Kobayashi | Jan 1998 | A |
5717903 | Bonola | Feb 1998 | A |
5720609 | Pfefferle | Feb 1998 | A |
5721222 | Bernstein et al. | Feb 1998 | A |
5729760 | Poisner | Mar 1998 | A |
5737604 | Miller et al. | Apr 1998 | A |
5737760 | Grimmer, Jr. et al. | Apr 1998 | A |
5740178 | Jacks et al. | Apr 1998 | A |
5752046 | Oprescu et al. | May 1998 | A |
5757919 | Herbert et al. | May 1998 | A |
5764969 | Kahle et al. | Jun 1998 | A |
5796835 | Saada | Aug 1998 | A |
5796845 | Serikawa et al. | Aug 1998 | A |
5805712 | Davis | Sep 1998 | A |
5809546 | Greenstein et al. | Sep 1998 | A |
5825875 | Ugon | Oct 1998 | A |
5825880 | Sudia et al. | Oct 1998 | A |
5835594 | Albrecht et al. | Nov 1998 | A |
5838968 | Culbert | Nov 1998 | A |
5844986 | Davis | Dec 1998 | A |
5852717 | Bhide et al. | Dec 1998 | A |
5854913 | Goetz et al. | Dec 1998 | A |
5867577 | Patarin | Feb 1999 | A |
5872994 | Akiyama et al. | Feb 1999 | A |
5890189 | Nozue et al. | Mar 1999 | A |
5900606 | Rigal | May 1999 | A |
5901225 | Ireton et al. | May 1999 | A |
5903752 | Dingwall et al. | May 1999 | A |
5919257 | Trostle | Jul 1999 | A |
5935242 | Madany et al. | Aug 1999 | A |
5935247 | Pai et al. | Aug 1999 | A |
5937063 | Davis | Aug 1999 | A |
5953502 | Helbig, Sr. | Sep 1999 | A |
5956408 | Arnold | Sep 1999 | A |
5970147 | Davis et al. | Oct 1999 | A |
5978475 | Schneier et al. | Nov 1999 | A |
5978481 | Ganesan et al. | Nov 1999 | A |
5987557 | Ebrahim | Nov 1999 | A |
6014745 | Ashe | Jan 2000 | A |
6035374 | Panwar et al. | Mar 2000 | A |
6044478 | Green | Mar 2000 | A |
6055637 | Hudson et al. | Apr 2000 | A |
6058478 | Davis | May 2000 | A |
6061794 | Angelo | May 2000 | A |
6075938 | Bugnion et al. | Jun 2000 | A |
6085296 | Karkhanis et al. | Jul 2000 | A |
6088262 | Nasu | Jul 2000 | A |
6092095 | Maytal | Jul 2000 | A |
6093213 | Favor et al. | Jul 2000 | A |
6101584 | Satou et al. | Aug 2000 | A |
6108644 | Goldschlag et al. | Aug 2000 | A |
6115816 | Davis | Sep 2000 | A |
6125430 | Noel et al. | Sep 2000 | A |
6131166 | Wong-Insley | Oct 2000 | A |
6148379 | Schimmel | Nov 2000 | A |
6158546 | Hanson et al. | Dec 2000 | A |
6173417 | Merrill | Jan 2001 | B1 |
6175924 | Arnold | Jan 2001 | B1 |
6175925 | Nardone et al. | Jan 2001 | B1 |
6178509 | Nardone et al. | Jan 2001 | B1 |
6182089 | Ganapathy et al. | Jan 2001 | B1 |
6188257 | Buer | Feb 2001 | B1 |
6192455 | Bogin et al. | Feb 2001 | B1 |
6199152 | Kelly et al. | Mar 2001 | B1 |
6205550 | Nardone et al. | Mar 2001 | B1 |
6212635 | Reardon | Apr 2001 | B1 |
6222923 | Schwenk | Apr 2001 | B1 |
6249872 | Wildgrube et al. | Jun 2001 | B1 |
6252650 | Nakamura | Jun 2001 | B1 |
6269392 | Cotichini et al. | Jul 2001 | B1 |
6272533 | Browne | Aug 2001 | B1 |
6272637 | Little et al. | Aug 2001 | B1 |
6275933 | Fine et al. | Aug 2001 | B1 |
6282650 | Davis | Aug 2001 | B1 |
6282651 | Ashe | Aug 2001 | B1 |
6282657 | Kaplan et al. | Aug 2001 | B1 |
6292874 | Barnett | Sep 2001 | B1 |
6301646 | Hostetter | Oct 2001 | B1 |
6308270 | Guthery et al. | Oct 2001 | B1 |
6314409 | Schneck et al. | Nov 2001 | B2 |
6321314 | Van Dyke | Nov 2001 | B1 |
6327652 | England et al. | Dec 2001 | B1 |
6330670 | England et al. | Dec 2001 | B1 |
6339815 | Feng | Jan 2002 | B1 |
6339816 | Bausch | Jan 2002 | B1 |
6357004 | Davis | Mar 2002 | B1 |
6363485 | Adams | Mar 2002 | B1 |
6374286 | Gee et al. | Apr 2002 | B1 |
6374317 | Ajanovic et al. | Apr 2002 | B1 |
6378068 | Foster | Apr 2002 | B1 |
6378072 | Collins et al. | Apr 2002 | B1 |
6389537 | Davis et al. | May 2002 | B1 |
6397242 | Devine et al. | May 2002 | B1 |
6397379 | Yates, Jr. et al. | May 2002 | B1 |
6408393 | Imada et al. | Jun 2002 | B1 |
6412035 | Webber | Jun 2002 | B1 |
6421702 | Gulick | Jul 2002 | B1 |
6435416 | Slassi | Aug 2002 | B1 |
6445797 | McGough et al. | Sep 2002 | B1 |
6463535 | Drews et al. | Oct 2002 | B1 |
6463537 | Tello | Oct 2002 | B1 |
6466962 | Bollella | Oct 2002 | B2 |
6496847 | Bugnion et al. | Dec 2002 | B1 |
6499123 | McFarlane et al. | Dec 2002 | B1 |
6505279 | Phillips et al. | Jan 2003 | B1 |
6507904 | Ellison et al. | Jan 2003 | B1 |
6529909 | Bowman-Amuah | Mar 2003 | B1 |
6535988 | Poisner | Mar 2003 | B1 |
6557104 | Vu et al. | Apr 2003 | B2 |
6560627 | McDonald et al. | May 2003 | B1 |
6609199 | DeTreville | Aug 2003 | B1 |
6615278 | Curtis | Sep 2003 | B1 |
6633963 | Ellison et al. | Oct 2003 | B1 |
6633981 | Davis | Oct 2003 | B1 |
6651171 | England et al. | Nov 2003 | B1 |
6678825 | Ellison et al. | Jan 2004 | B1 |
6684326 | Cromer et al. | Jan 2004 | B1 |
6807522 | Orfali | Oct 2004 | B1 |
6859926 | Brenner et al. | Feb 2005 | B1 |
6947988 | Saleh | Sep 2005 | B1 |
20010021969 | Burger et al. | Sep 2001 | A1 |
20010027511 | Wakabayashi et al. | Oct 2001 | A1 |
20010027527 | Khidekel et al. | Oct 2001 | A1 |
20010037450 | Metlitski et al. | Nov 2001 | A1 |
20020007456 | Peinado et al. | Jan 2002 | A1 |
20020023032 | Pearson et al. | Feb 2002 | A1 |
20020147916 | Strongin et al. | Oct 2002 | A1 |
20020152305 | Jackson et al. | Oct 2002 | A1 |
20020166061 | Falik et al. | Nov 2002 | A1 |
20020169717 | Challener | Nov 2002 | A1 |
20030018892 | Tello | Jan 2003 | A1 |
20030037089 | Cota-Robles et al. | Feb 2003 | A1 |
20030074548 | Cromer et al. | Apr 2003 | A1 |
20030115453 | Grawrock | Jun 2003 | A1 |
20030126442 | Glew et al. | Jul 2003 | A1 |
20030126453 | Glew et al. | Jul 2003 | A1 |
20030159056 | Cromer et al. | Aug 2003 | A1 |
20030188179 | Challener et al. | Oct 2003 | A1 |
20030196085 | Lampson et al. | Oct 2003 | A1 |
20030225878 | Eatough et al. | Dec 2003 | A1 |
20040117539 | Bennett et al. | Jun 2004 | A1 |
20040143664 | Usa et al. | Jul 2004 | A1 |
Number | Date | Country |
---|---|---|
0930567 | Jul 1999 | EP |
WO9834365 | Aug 1998 | WO |
WO9844402 | Oct 1998 | WO |
WO9905600 | Feb 1999 | WO |
WO9909482 | Feb 1999 | WO |
WO9957863 | Nov 1999 | WO |
WO0062232 | Oct 2000 | WO |
Number | Date | Country | |
---|---|---|---|
20040010788 A1 | Jan 2004 | US |