summaryrefslogtreecommitdiffstats
path: root/documentation/book-enea-linux-users-guide/doc/cpu_isolation.xml
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/book-enea-linux-users-guide/doc/cpu_isolation.xml')
-rw-r--r--documentation/book-enea-linux-users-guide/doc/cpu_isolation.xml80
1 files changed, 80 insertions, 0 deletions
diff --git a/documentation/book-enea-linux-users-guide/doc/cpu_isolation.xml b/documentation/book-enea-linux-users-guide/doc/cpu_isolation.xml
new file mode 100644
index 0000000..e259c00
--- /dev/null
+++ b/documentation/book-enea-linux-users-guide/doc/cpu_isolation.xml
@@ -0,0 +1,80 @@
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4<section condition="f_ci" id="enea-linux-realtime-cpu-isolation">
5 <title>CPU Isolation</title>
6
7 <note>
8 <para>The level of feature support is target specific. Look up the <link
9 linkend="feature-matrix">Feature Compatibility Matrix</link> to see how
10 your target supports this feature.</para>
11 </note>
12
13 <para><emphasis role="bold">CPU isolation</emphasis><indexterm>
14 <primary>CPU isolation</primary>
15 </indexterm><indexterm>
16 <primary>isolation</primary>
17 </indexterm> facilitates predictable task scheduling, hence real-time
18 properties, by protecting SMP<indexterm>
19 <primary>SMP</primary>
20 </indexterm> CPUs<indexterm>
21 <primary>CPU</primary>
22 </indexterm> from being disturbed by unnecessary interrupts and unwanted
23 tasks. The isolated CPUs are granted a tickless environment, and are
24 excluded from load balancing. Any CPU except for CPU 0 can be
25 isolated.</para>
26
27 <para>Depending on the capabilities of the kernel for the specific target,
28 the isolated CPUs can obtain a tickless or nearly tickless environment. A
29 tickless environment means that isolated CPUs get no ticks at all (0 Hz).
30 Nearly tickless environment means that isolated CPUs are still disturbed by
31 ticks once a second (1 Hz).</para>
32
33 <para>The CPU isolation process involves several steps until a CPU is fully
34 isolated. Enea Linux simplifies this process for you by implementing in the
35 distribution kernel patching and configuration, and providing a script that
36 performs the partitioning in runtime.</para>
37
38 <orderedlist>
39 <listitem>
40 <para>Install <emphasis role="italic">partrt</emphasis> in Enea
41 Linux</para>
42 </listitem>
43
44 <listitem>
45 <para><phrase id="enea-linux-realtime-cpu-isolation-boot">Load and
46 boot</phrase> Enea Linux on target as described in the <link
47 linkend="enea-linux-target">Target Guide</link>, but also add the boot
48 parameters <literal>isolcpus</literal><indexterm>
49 <primary>isolcpus</primary>
50 </indexterm> and <literal>nohz</literal><indexterm>
51 <primary>nohz</primary>
52 </indexterm> telling which CPUs to isolate.</para>
53
54 <para>If booted by U-Boot:</para>
55
56 <programlisting>setenv bootargs &lt;other params&gt; <emphasis
57 role="bold">isolcpus=2,3 nohz_full=2,3</emphasis></programlisting>
58
59 <para>If booted by PXE:</para>
60
61 <programlisting>append &lt;other params&gt; <emphasis role="bold">isolcpus=2,3 nohz_full=2,3</emphasis></programlisting>
62 </listitem>
63
64 <listitem>
65 <para>After booting the Linux kernel, execute the <emphasis
66 role="bold">partrt</emphasis><indexterm>
67 <primary>partrt</primary>
68 </indexterm> script to create real-time partitions for the isolated
69 CPUs. Each CPU is coded as a binary number. The argument to partrt is an
70 OR-ed bit mask of the CPU/s to add to the real-time partition, here
71 0100<subscript>2</subscript> (CPU 2) OR 1000<subscript>2</subscript>
72 (CPU 3) = 1100<subscript>2</subscript> (0xc).</para>
73
74 <programlisting>$ partrt create 0xc</programlisting>
75
76 <para>CPUs 2 and 3 now provide an optimal real-time environment for your
77 application.</para>
78 </listitem>
79 </orderedlist>
80</section> \ No newline at end of file