Real-Time (RT) kernel
A real-time system is a deterministic system, where response to an event is expected in a set time. A system is classified as compatible with RT if:- It’s devoid of unbounded latency.
- The maximum response time is calculated with precision.
- It meets the set criteria for scheduling of tasks (latency and deadline).
The real-time support is for kernelspace process and not for userspace.
This section isn’t applicable for QCS5430.
Figure : Build sequence
Set up the workspace
The Qualcomm Linux kernel supports the LTS RT kernel (6.18.x), which is maintained through the Yocto recipe in themeta-qcom layer in the recipes-kernel/linux/linux-qcom-rt_6.18.bb file.
For more information about cloning the workspace and getting all Qualcomm Linux meta layers to use Qualcomm RT Linux, see Sync.
Enable the RT kernel
The Qualcomm Linuxmeta-qcom layer supports linux-qcom-rt_6.18.bb recipe that fetches and builds the Qualcomm Linux kernel for the supported machines by default.
The meta-qcom layer applies the changes on top of the existing layer. During the kernel build, meta-qcom layer enables PREEMPT_RT using rt.config based on the kernel version, and allows real-time configurations.
- Use
linux-qcom-rt_6.18.bbfor QLI.2.0. - Use
linux-qcom-next-rt_git.bbforqcom-next.
Customize the RT kernel
- If you are carrying any changes for the RT kernel, maintain them in the recipe as shown below:
- Maintain the patch file under
recipes-kernel/linux/linux-qcom-6.18/<your_patch_file>.patch - Append the patch file to
SRC_URIin therecipes-kernel/linux/linux-qcom-rt_6.18.bbfile.
- Maintain the patch file under
- To apply any external configurations on the RT kernel:
- Maintain the configuration file in the
recipes-kernel/linux/linux-qcom-6.18/configs/<your_config>.cfgrecipe. - Append the configuration file to
SRC_URIin therecipes-kernel/linux/linux-qcom-rt_6.18.bbfile.
- Maintain the configuration file in the
- To modify the kernel command-line, add the command-line parameters into the
meta-qcom/ci/base.ymlfile toKERNEL_CMDLINE_EXTRAvariable.
Configure kernel settings for the RT kernel
Optional and mandatory kernel configurations are used in the RT kernel. To enable full preemption in the RT kernel, useCONFIG_PREEMPT_RT.
The CONFIG_PREEMPT_RT flag is enabled by default as part of the rt.config used in linux-qcom-rt_6.18.bb recipe.
The following example shows the kernel configuration:
CONFIG_NO_HZ_COMMON- When enabled, it configures the kernel infrastructure for tickless operation.CONFIG_NO_HZ_FULL- When enabled, it configures the kernel to avoid sending scheduling-clock interrupts to CPUs with a single runnable task.CONFIG_CPUSETS- Use theCONFIG_CPUSETSconfiguration option to enablecpuset, where the CPU is grouped to form a set.
Figure: RT kernel verification
Build the RT kernel
To build the RT kernel, run the following commands:- To ensure that you are in the KAS shell, run the following command:
The
qcom-distro-kvm.yml configuration is supported with KVM only for QLI 2.0. The RT kernel (PREEMPT_RT) is hypervisor-agnostic. KVM is selected as the default hypervisor for QLI 2.0 due to the following reasons:- Upstream community support — KVM and its drivers are part of the mainline Linux kernel, enabling broader ecosystem contributions and long-term support.
- Standard VirtIO support — KVM supports all upstream VirtIO devices and is compatible with standard VMMs such as QEMU.
- Open development — Active upstream community with broader developer familiarity.
xbl_config_kvm.elf in the generated qcomflash package. No manual UEFI BDS configuration is required.
Copy the kas lock file from meta-qcom-releases to meta-qcom, see Build a BSP image.
- To compile the BitBake Qualcomm Linux multimedia image, run the following command:
Tune the RT kernel
Tune the RT kernel to achieve a deterministic latency for RT tasks in the device. Set the CPU cores that run RT tasks to run at maximum operating frequency while preventing thermal mitigation of CPU frequency. For example, in an idle sleep scenario, RT tasks face scheduling latency due to CPU wake time delay.These optimizations are automatically applied by the URM. when RT tests(cyclictest) is launched.
Manual configuration is not required under normal operation. The following steps are provided for reference, debugging, or custom setups.To configure the system before running the tests, do the following for QCS6490, Qualcomm Dragonwing™ IQ-9075, and Qualcomm Dragonwing™ IQ-615 Development Kit:
- Disable the timer migration:
- Affine all kernel work queues in
/sys/devices/virtual/workqueue/*to the housekeeping CPUs: - Set CPU frequency governor to performance:
- Disable RT accounting/throttling:
- Set IRQ affinity to housekeeping CPUs:
- Disable the timer migration:
- Affine all kernel work queues in
/sys/devices/virtual/workqueue/*to the housekeeping CPUs: - Set CPU frequency governor to performance:
- Disable RT accounting/throttling:
- Set IRQ affinity to housekeeping CPUs:
meta-qcom/conf/machine/<machine-name.conf>:- CPU cores 7
- IRQ affine to core 0-6
- RCU no call back 7
Test the RT kernel
A suite of tests is available in the Linux foundation RT test suite. The RT Linux kernel test obtains the following information:- Real-time performance of the RT Linux kernel
- RT Linux kernel latencies and key performance indicators (KPIs)
Don’t reboot the system during the RT Linux kernel test as it runs for over 24 hours.
- Cyclictest with no-load: System load isn’t added to perform this test.
- Cyclictest with stress-ng (next-generation): Specific percentage of load is added to perform this test to measure the worst case system latencies.
- Run the following cyclic test for QCS6490, Qualcomm Dragonwing™ IQ-9075, and Qualcomm Dragonwing™ IQ-615 development kits:
- Run the following cyclic test for the Dragonwing™ IQ-8275 Development Kit:
- Note the latencies.
- Set the target CPU load. Define the desired CPU load percentage. If not specified, the default load is 60%:
- Run stress-ng on selected CPU cores in the background. Apply CPU load on cores 0, 1, 2, 4, 5, 6, and 7 using stress-ng. Each instance runs for one day and is pinned to a specific CPU core:
- Run the cyclic latency test. Execute cyclictest with high priority to measure scheduling latency. The test runs for approximately 27.78 hours:
- Note the worst-case latencies.
- Set the target CPU load:
- Run stress-ng on selected CPU cores:
- Run the cyclic latency test:
- Note the worst-case latencies.
RT test results
RT Benchmarks by Platform
RT Benchmarks IQX
Benchmark results for IQ-X series high-performance platforms
RT Benchmarks IQ9
Benchmark results for the Dragonwing IQ-9075 platform
RT Benchmarks IQ8
Benchmark results for the Dragonwing IQ-8275 platform
RT Benchmarks IQ6
Benchmark results for the Dragonwing IQ-615 platform

