Figure 2.11 A virtual machine with multiple virtual processors being scheduled to the
available logical processors
Here’s a great analogy: Consider going out to dinner with a group of friends. You sit
down, open the menu, and know exactly what you want to eat. You then proceed to sit
there for 15 minutes until everyone else has decided what they will order, because you
have to all order at the same time. You are, in essence, gang scheduled.
Nobody has been able to create a perfect gang scheduler that does not lead to delays
and inefficiencies. It is because of this gang scheduling that with some hypervisors,
you need to minimize the number of virtual processors per virtual machine as much
as possible.
Hyper-V does not use gang scheduling and instead takes an alternate approach to
handling multiprocessor virtual machines and the scheduling to logical processors.
Remember, the problem is that operating systems believe that all of their processors
are available to run at the same time. Rather than trying to work around this problem,
Microsoft fixed the operating system kernel itself so that the operating system no
longer assumes that all processors will be scheduled at the same time. This enables
Hyper-V to schedule virtual processors from a multiprocessor virtual machine
independently of each other, which allows virtual processors to be scheduled only as
they have workload. This is known as free processor scheduling. This fix was made in
Windows Server 2008, which is why Windows Server 2000 supports only a single
processor. A targeted change was made to the kernel in Windows Server 2003 Service
Pack 2 and Windows XP Service Pack 3, which allows for two virtual processors to be
configured. Because gang scheduling is not used with Hyper-V, there is no guidance to
limit the number of virtual processors in a virtual machine. Having lots of idle