aboutsummaryrefslogtreecommitdiffstats
path: root/docs/src/user/cpu_management.tex
blob: e4565f00a9933ed9faba882eb57d00d6cb8b4095 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
\chapter{CPU Management}

Placeholder.
%% KMS Something sage about CPU / processor management.

Xen allows a domain's virtual CPU(s) to be associated with one or more
host CPUs.  This can be used to allocate real resources among one or
more guests, or to make optimal use of processor resources when
utilizing dual-core, hyperthreading, or other advanced CPU technologies.

Xen enumerates physical CPUs in a `depth first' fashion.  For a system
with both hyperthreading and multiple cores, this would be all the
hyperthreads on a given core, then all the cores on a given socket,
and then all sockets.  I.e.  if you had a two socket, dual core,
hyperthreaded Xeon the CPU order would be:


\begin{center}
\begin{tabular}{|l|l|l|l|l|l|l|r|}
\multicolumn{4}{c|}{socket0}     &  \multicolumn{4}{c|}{socket1} \\ \hline
\multicolumn{2}{c|}{core0}  &  \multicolumn{2}{c|}{core1}  &
\multicolumn{2}{c|}{core0}  &  \multicolumn{2}{c|}{core1} \\ \hline
ht0 & ht1 & ht0 & ht1 & ht0 & ht1 & ht0 & ht1 \\
\#0 & \#1 & \#2 & \#3 & \#4 & \#5 & \#6 & \#7 \\
\end{tabular}
\end{center}


Having multiple vcpus belonging to the same domain mapped to the same
physical CPU is very likely to lead to poor performance. It's better to
use `vcpus-set' to hot-unplug one of the vcpus and ensure the others are
pinned on different CPUs.

If you are running IO intensive tasks, its typically better to dedicate
either a hyperthread or whole core to running domain 0, and hence pin
other domains so that they can't use CPU 0. If your workload is mostly
compute intensive, you may want to pin vcpus such that all physical CPU
threads are available for guest domains.


\section{Setting CPU Pinning}

FIXME:  To specify a domain's CPU pinning use the XXX command/syntax in
XXX.