Configuring scheduler priority for the QM partition using Automotive Image Builder¶
To configure scheduler priority to minimize latency and interference, you must tune the CPUWeight
for the
QM partition to a value between 1 and 100.
CPUWeight
is an attribute you can set for hierarchical Linux kernel systemd control groups (cgroups).
It splits the available CPU time among all units within one slice relative to their CPU time weight.
A higher weight means more CPU time, a lower weight means less.
Automotive Image Builder sets default central processing unit (CPU) scheduler priority for the QM partition to CPUWeight=idle
.
That means processes in the QM partition do not run until critical processes running on the root partition are idle.
If you use the default scheduler priority, it might starve processes in the QM partition of CPU time, so it is important that you
find the optimal setting for your needs.
Prerequisites
- A custom manifest file with a QM partition, such as the manifest file that you created in Embedding containerized applications in the QM partition
Procedure
-
In your manifest file, set the
cpu_weight
for the entire QM partition to a value between 1 and 100. For example, if you were to setCPUWeight=50
, all processes in your QM partition would receive half the CPU time that is available to the critical processes running on your root partition.
Verification
-
Use Automotive Image Builder to build your image from the manifest:
-
Use
automotive-image-runner
to start your image: -
After the image starts, log in as
root
using the passwordpassword
. -
Use the
systemctl show
command to display the defaultCPUWeight
and the path for the drop-in configuration file generated by thecpu_weight
value you set in your manifest: -
Review the contents of the drop-in file generated by your manifest using the
cat
command:
Additional resources
- systemd.resource-control(5) Linux manual page
- sched(7) Linux manual page
- Real-time group scheduling from Kernel.org
- Linux kernel Completely Fair Scheduler (CFS) from Kernel.org
- Controlling distribution of CPU time for applications by adjusting CPU weight in RHEL for Real Time
- containers/qm CGroups and container configuration
- Mixed criticality
- About external watchdogs
- A more reactive, deterministic Real-time Linux kernel