credit scheduler
While doing some performance analysis of Xen I have noticed some interesting behavior of the credit scheduler that I would like to see discussed.
In my most basic test I have a 4 socket dual core Intel box (Paxville) with a uniprocessor dom0 and 7 uniprocessor domUs. Each of the domUs is pinned on its own core with the first core of the system left for dom0. When running the credit scheduler the dom0 VCPU will bounce around the system, sometimes landing on the same thread as one of the domUs or sometimes on one of the sibling hyperthreads (this appears to happen a majority of the time it moves). This is less than ideal when considering cache warmth and the sharing of CPU resources when the first core of the system is always available in this configuration. Does the credit scheduler have any awareness of cache warmth or CPU siblings when balancing?
I have also seen similar behavior when running tests in the domUs such that each has its VCPU running at 100% utilization so I believe this behavior to be fairly uniform.
In my testing I am looking for uniform behavior so I have just been setting sched=sedf but I would like to move to credit scheduler since it is the new default. However, until I sort out this behavior I cannot.
Attached is a snapshot of "xm vcpu-list" taken every 5 seconds for 5 measurements to show the dom0 VCPU migration pattern on a system with idle domains.
Signature · 3 lines
Karl Rister IBM Linux Performance Team [email protected]
Name ID VCPU CPU State Time(s) CPU Affinity Domain-0 0 0 7 r-- 402.2 any cpu Domain-0 0 1 - --p 0.0 any cpu Domain-0 0 2 - --p 0.0 any cpu Domain-0 0 3 - --p 0.0 any cpu Domain-0 0 4 - --p 0.0 any cpu Domain-0 0 5 - --p 0.0 any cpu Domain-0 0 6 - --p 0.0 any cpu Domain-0 0 7 - --p 0.0 any cpu Domain-0 0 8 - --p 0.0 any cpu Domain-0 0 9 - --p 0.0 any cpu Domain-0 0 10 - --p 0.0 any cpu Domain-0 0 11 - --p 0.0 any cpu Domain-0 0 12 - --p 0.0 any cpu Domain-0 0 13 - --p 0.0 any cpu Domain-0 0 14 - --p 0.0 any cpu Domain-0 0 15 - --p 0.0 any cpu dom1 1 0 2 -b- 21.0 2 dom2 2 0 4 -b- 21.4 4 dom3 3 0 6 -b- 20.8 6 dom4 4 0 8 -b- 21.0 8 dom5 5 0 10 -b- 21.5 10 dom6 6 0 12 -b- 21.1 12 dom7 7 0 14 -b- 20.4 14 Name ID VCPU CPU State Time(s) CPU Affinity Domain-0 0 0 6 r-- 402.7 any cpu Domain-0 0 1 - --p 0.0 any cpu Domain-0 0 2 - --p 0.0 any cpu Domain-0 0 3 - --p 0.0 any cpu Domain-0 0 4 - --p 0.0 any cpu Domain-0 0 5 - --p 0.0 any cpu Domain-0 0 6 - --p 0.0 any cpu Domain-0 0 7 - --p 0.0 any cpu Domain-0 0 8 - --p 0.0 any cpu Domain-0 0 9 - --p 0.0 any cpu Domain-0 0 10 - --p 0.0 any cpu Domain-0 0 11 - --p 0.0 any cpu Domain-0 0 12 - --p 0.0 any cpu Domain-0 0 13 - --p 0.0 any cpu Domain-0 0 14 - --p 0.0 any cpu Domain-0 0 15 - --p 0.0 any cpu dom1 1 0 2 -b- 21.0 2 dom2 2 0 4 -b- 21.4 4 dom3 3 0 6 -b- 20.8 6 dom4 4 0 8 -b- 21.0 8 dom5 5 0 10 -b- 21.5 10 dom6 6 0 12 -b- 21.1 12 dom7 7 0 14 -b- 20.5 14 Name ID VCPU CPU State Time(s) CPU Affinity Domain-0 0 0 6 r-- 403.0 any cpu Domain-0 0 1 - --p 0.0 any cpu Domain-0 0 2 - --p 0.0 any cpu Domain-0 0 3 - --p 0.0 any cpu Domain-0 0 4 - --p 0.0 any cpu Domain-0 0 5 - --p 0.0 any cpu Domain-0 0 6 - --p 0.0 any cpu Domain-0 0 7 - --p 0.0 any cpu Domain-0 0 8 - --p 0.0 any cpu Domain-0 0 9 - --p 0.0 any cpu Domain-0 0 10 - --p 0.0 any cpu Domain-0 0 11 - --p 0.0 any cpu Domain-0 0 12 - --p 0.0 any cpu Domain-0 0 13 - --p 0.0 any cpu Domain-0 0 14 - --p 0.0 any cpu Domain-0 0 15 - --p 0.0 any cpu dom1 1 0 2 -b- 21.0 2 dom2 2 0 4 -b- 21.4 4 dom3 3 0 6 -b- 20.8 6 dom4 4 0 8 -b- 21.0 8 dom5 5 0 10 -b- 21.5 10 dom6 6 0 12 -b- 21.1 12 dom7 7 0 14 -b- 20.5 14 Name ID VCPU CPU State Time(s) CPU Affinity Domain-0 0 0 6 r-- 403.4 any cpu Domain-0 0 1 - --p 0.0 any cpu Domain-0 0 2 - --p 0.0 any cpu Domain-0 0 3 - --p 0.0 any cpu Domain-0 0 4 - --p 0.0 any cpu Domain-0 0 5 - --p 0.0 any cpu Domain-0 0 6 - --p 0.0 any cpu Domain-0 0 7 - --p 0.0 any cpu Domain-0 0 8 - --p 0.0 any cpu Domain-0 0 9 - --p 0.0 any cpu Domain-0 0 10 - --p 0.0 any cpu Domain-0 0 11 - --p 0.0 any cpu Domain-0 0 12 - --p 0.0 any cpu Domain-0 0 13 - --p 0.0 any cpu Domain-0 0 14 - --p 0.0 any cpu Domain-0 0 15 - --p 0.0 any cpu dom1 1 0 2 -b- 21.0 2 dom2 2 0 4 -b- 21.4 4 dom3 3 0 6 -b- 20.8 6 dom4 4 0 8 -b- 21.0 8 dom5 5 0 10 -b- 21.5 10 dom6 6 0 12 -b- 21.1 12 dom7 7 0 14 -b- 20.5 14 Name ID VCPU CPU State Time(s) CPU Affinity Domain-0 0 0 5 r-- 403.8 any cpu Domain-0 0 1 - --p 0.0 any cpu Domain-0 0 2 - --p 0.0 any cpu Domain-0 0 3 - --p 0.0 any cpu Domain-0 0 4 - --p 0.0 any cpu Domain-0 0 5 - --p 0.0 any cpu Domain-0 0 6 - --p 0.0 any cpu Domain-0 0 7 - --p 0.0 any cpu Domain-0 0 8 - --p 0.0 any cpu Domain-0 0 9 - --p 0.0 any cpu Domain-0 0 10 - --p 0.0 any cpu Domain-0 0 11 - --p 0.0 any cpu Domain-0 0 12 - --p 0.0 any cpu Domain-0 0 13 - --p 0.0 any cpu Domain-0 0 14 - --p 0.0 any cpu Domain-0 0 15 - --p 0.0 any cpu dom1 1 0 2 -b- 21.0 2 dom2 2 0 4 -b- 21.4 4 dom3 3 0 6 -b- 20.8 6 dom4 4 0 8 -b- 21.0 8 dom5 5 0 10 -b- 21.5 10 dom6 6 0 12 -b- 21.1 12 dom7 7 0 14 -b- 20.5 14
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 4 lines · Karl Rister
This is less than ideal when considering cache warmth and the sharing of CPU resources when the first core of the system is always available in this configuration. Does the credit scheduler have any awareness of cache warmth or CPU siblings when balancing?
It doesn't right now, but in your setup dom0 has its 'home core' all to itself, so it's odd that it's bouncing around. Other cores should only steal the domain if it is runnable but not running -- that should almost never be the case if the domain is not contending for CPU.
-- Keir
I've seen something similar... I have a cpu with two HT and two domains (single-vcpu dom0 and an HVM domain), and I'm using the VMEXIT/VMENTER tracing. The most natural thing would be for each to get its own logical cpu, but under the credit scheduler, the HVM domain is seeing the VMENTER on a different logical cpu than it took the VMEXIT on. This makes the RDTSC values taken not comparable.
-George
Quoted 24 lines · Keir Fraser
Quoted 4 lines · Karl Rister
This is less than ideal when considering cache warmth and the sharing of CPU resources when the first core of the system is always available in this configuration. Does the credit scheduler have any awareness of cache warmth or CPU siblings when balancing?
It doesn't right now, but in your setup dom0 has its 'home core' all to itself, so it's odd that it's bouncing around. Other cores should only steal the domain if it is runnable but not running -- that should almost never be the case if the domain is not contending for CPU.
-- Keir
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 13 lines · Karl Rister
While doing some performance analysis of Xen I have noticed some interesting behavior of the credit scheduler that I would like to see discussed.
In my most basic test I have a 4 socket dual core Intel box (Paxville) with a uniprocessor dom0 and 7 uniprocessor domUs. Each of the domUs is pinned on its own core with the first core of the system left for dom0. When running the credit scheduler the dom0 VCPU will bounce around the system, sometimes landing on the same thread as one of the domUs or sometimes on one of the sibling hyperthreads (this appears to happen a majority of the time it moves). This is less than ideal when considering cache warmth and the sharing of CPU resources when the first core of the system is always available in this configuration. Does the credit scheduler have any awareness of cache warmth or CPU siblings when balancing?
A related issue I noticed the other day when doing xen testing off of xen-unstable was that the irqbalancer process ended up consuming 100% of dom0 cpu when running an SMP Dom0 on the credit scheduler, and a bunch of idle domUs. It got the the point that ssh wasn't feasable, and I had to go to the console and shut off irqbalancer to return things to normal.
I'd follow up further, but I'm about to go "off grid" for the next 2.5 weeks. I relayed information to other folks on the IBM team to see if anyone else can reproduce it.
-Sean
Signature · 3 lines
Sean Dague IBM Linux Technology Center email: [email protected] Open Hypervisor Team alt: [email protected]
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 3 lines · Karl Rister
In my testing I am looking for uniform behavior so I have just been setting sched=sedf but I would like to move to credit scheduler since it is the new default. However, until I sort out this behavior I cannot.
One thing you could do is restrict dom0's VCPU so that it doesn't move around to a hyperthread on a core that you have assigned to a domU.
So figure out what CPU dom0's VCPU is on and restrict its cpumask so that it stays on that core. Then move any domU out of that core.