# Features impacting performance

The Qualcomm^®^ Linux^®^ kernel includes features such as the CPU scheduler,
CPU frequency governor, dynamic voltage and frequency scaling (DVFS),
and memory management. This guide provides an overview of each feature
and related reference links. Additionally, Qualcomm has added a feature
called PerfHAL to enhance the performance of Qualcomm Linux.

## CPU scheduler

The CPU scheduler manages how the CPU time is distributed among the
processes running on Linux systems.

The CPU scheduler uses [the earliest eligible virtual deadline first (EEVDF) CPU scheduler for Linux](https://lwn.net/Articles/925371/), which is provided by the Linux kernel. The EEVDF CPU scheduler uses [Per-entity load tracking \[LWN.net\]](https://lwn.net/Articles/531853/) to monitor the task load.

[Utilization clamping (UCLAMP or util clamp)](https://docs.kernel.org/scheduler/sched-util-clamp.html) is a scheduler that helps manage performance requirements for tasks.

For more information, see [Customize CPU scheduler](https://docs.qualcomm.com/doc/80-70029-10/topic/18-customize.html#customize-scheduler).

## CPU frequency governor

A CPU frequency governor adjusts the CPU frequency based on the task
load. The CPU scheduler provides the necessary inputs for this process.

Qualcomm Linux uses the `schedutil` governor, provided by
the Linux kernel.

This governor increases the CPU frequency when the system is heavily loaded
and reduces it when the load is low, ensuring an optimal balance between
power consumption and performance.

For more information, see the following:

- [CPU frequency and voltage scaling code in the Linux kernel](https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt)
- [Configure CPU](https://docs.qualcomm.com/doc/80-70029-10/topic/14-configure.html#cpu)
- [Customize the CPU frequency governor](https://docs.qualcomm.com/doc/80-70029-10/topic/18-customize.html#cpu-frequency-governer)

## DVFS governors

DVFS governors control the frequencies of CPU caches (L3), the last
level cache controller (LLCC), and the DDR based on the system workload.

These governors increase the frequency when the workload is high and
decrease it when the workload is low, ensuring an optimal balance
between power consumption and performance.

Qualcomm Linux supports the following two types of DVFS governors for L3 cache:

- LLCC
- DDR

### Static map DVFS governor

This governor aligns the frequencies of the CPU L3 cache and the DDR with
the current CPU frequency to balance the power and the performance requirements.

For example, if the CPU frequency is at its maximum, the L3 cache and
DDR frequencies must also be at their maximum levels.

The static mapping is available in the source code at
`arch/arm64/boot/dts/qcom/<target>.dtsi`.

For customization options, see [Customize static map DVFS governor](https://docs.qualcomm.com/doc/80-70029-10/topic/18-customize.html#section-u1x-jps-51c-caharris-03-20-24-2005-37-832).

### BWMON governor

The bandwidth monitoring (BWMON) governor dynamically adjusts the
frequencies of the LLCC and DDR based on the measured traffic flow from
the CPU to the LLCC and then to the DDR.

The BWMON hardware block measures this traffic. It monitors the data
throughput between memory and the other subsystems within a specified
sampling window and uses this information to scale the LLCC and DDR
frequencies to meet the required bandwidth.

The BWMON governor driver is available in the source code at
`drivers/soc/qcom/icc-bwmon.c`.

For more information, see the following:

- [\[PATCH v3 0/4\] soc/arm64: qcom: Add initial version of
bwmon](https://lwn.net/ml/linux-kernel/20220531105137.110050-1-krzysztof.kozlowski@linaro.org/)
- [Customize BWMON governor](https://docs.qualcomm.com/doc/80-70029-10/topic/18-customize.html#section-qxs-4ps-51c-caharris-03-20-24-2007-2-926)

## PerfHAL

PerfHAL is a Qualcomm proprietary service that makes perflock APIs accessible. It's beneficial when
you need short-term performance enhancements or power savings.

Perflocks help in modifying system behavior to manage intermittent
workloads. For example, if a specific code segment must run at a higher
CPU frequency for a certain duration, use perflocks within that
code to boost the CPU frequency.

PerfHAL efficiently handles concurrent perflock requests from multiple
clients. When several requests are aimed at the same resource, PerfHAL
aggregates them to achieve the optimal performance level needed by the
device.

When a perflock of a client is no longer active, PerfHAL releases all
the perflocks associated with that client.

### Perflock APIs

Perflock APIs allow applications to adjust system
parameters for specific use cases, helping them meet their performance
and power objectives.

Userspace applications use the `perf_lock_acq()` and `perf_lock_rel()` APIs
to request specific values of system tunable parameters for both, a set
time period or an indefinite time period.

### Acquire perflock

Use the `perf_lock_acq()` API to acquire a perflock with the
necessary optimizations.

The syntax for this function is as follows:

`int perf_lock_acq(int handle, int duration, int list[], int numArgs)`

Table : perf_lock_acq API parameters

| Parameter | Description |
| --- | --- |
| `handle` | Identifies the client request. |
| `duration` | <ul class="simple"><br><li><p>Indicates the maximum timeout period that a perflock must<br>be held, in milliseconds.</p></li><br><li><p><code class="docutils literal notranslate"><span class="pre">duration</span></code> parameter can be set for a definite time or<br>for an indefinite time <code class="docutils literal notranslate"><span class="pre">(0)</span></code>.</p><ul><br><li><p>Definite perflocks require a positive integer value to<br>specify the maximum timeout period. A timer is created<br>and the perflock is released when the timer expires.</p></li><br><li><p>Indefinite perflocks are held until the client calls<br>the release function. To manually release a perflock<br>that has been set for an indefinite duration, use the<br><code class="code docutils literal notranslate"><span class="pre">perf_lock_rel()</span></code> API.</p></li><br></ul><br></li><br></ul> |
| `list` | An array of resource opcodes and value pairs. Opcodes<br>indicate a system parameter (resource) and the value to set<br>it (level). |
| `numArgs` | Number of elements in the list array. |

Table : perf_lock_acq API returns and result

| Returns | Result |
| --- | --- |
| A non-zero integer | Success |
| -1 | Failure |

### Perflock release

The `perf_lock_rel()` API is used to release a perflock that's held
by the `perf_lock_acq()` API. Use this function only for the perflocks
that are set for an indefinite time period. The syntax for this function is
as follows:

`int perf_lock_rel(int handle)`

Table : perf_lock_rel API parameters

| Parameter | Description |
| --- | --- |
| `handle` | <ul class="simple"><br><li><p>Tracks unique requests</p></li><br><li><p>Passes the same handle that <code class="docutils literal notranslate"><span class="pre">perf_lock_acq()</span></code> returns to release the lock</p></li><br></ul> |

Table : perf_lock_rel API returns and result

| Returns | Result |
| --- | --- |
| A non-zero integer | Success |
| -1 | Failure |

### Resource opcodes

Perflock uses a combination of opcodes and their corresponding values to
perform specific operations on a perflock resource.

To know the supported opcodes on Qualcomm Dragonwing^™^ IQ-9075, Qualcomm Dragonwing^™^ IQ-8275, and Qualcomm Dragonwing^™^ IQ-615, see the following corresponding addendum:

- [Qualcomm Linux Performance Guide - Addendum for Qualcomm Dragonwing IQ-9075](https://docs.qualcomm.com/bundle/resource/topics/80-70029-10A/overview.html)
- [Qualcomm Linux Performance Guide - Addendum for Qualcomm Dragonwing IQ-8275](https://docs.qualcomm.com/bundle/resource/topics/80-70029-10B/overview.html)
- [Qualcomm Linux Performance Guide - Addendum for Qualcomm Dragonwing IQ-615](https://docs.qualcomm.com/bundle/resource/topics/80-70029-10C/overview.html)

The following table lists the supported opcodes:

Table : Supported opcodes

| Opcode | Purpose | Sysnode on device |
| --- | --- | --- |
| 0x44000000 | Sets the minimum acceptable performance level for individual<br>tasks and task groups. | `/proc/sys/kernel/sched_util_clamp_min` |
| 0x44004000 | Sets the maximum acceptable performance level for individual<br>tasks and task groups. | `/proc/sys/kernel/sched_util_clamp_max` |
| 0x44008100 | Sets the minimum frequency of the Silver cluster. | `/sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq` |
| 0x44008000 | Sets the minimum frequency of the Gold cluster. | `/sys/devices/system/cpu/cpufreq/policy4/scaling_min_freq` |
| 0x44008200 | Sets the minimum frequency of the Prime cluster. | `/sys/devices/system/cpu/cpufreq/policy7/scaling_min_freq` |
| 0x4400C100 | Sets the maximum frequency of the Silver cluster. | `/sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq` |
| 0x4400C000 | Sets the maximum frequency of the Gold cluster. | `/sys/devices/system/cpu/cpufreq/policy4/scaling_max_freq` |
| 0x4400C200 | Sets the maximum frequency of the Prime cluster. | `/sys/devices/system/cpu/cpufreq/policy7/scaling_max_freq` |

The following are some examples of the resource opcodes:

- 0x44008100, 1958400: This pair of opcode and value indicates that the
minimum frequency of the Silver cluster must be set to 1958400 KHz.
- 0x44008100, 1958400, 0x4400C100, 2100000: This pair of opcode and
value indicates that the minimum frequency of the Silver cluster must
be set to 1958400 KHz. The maximum frequency of the Silver cluster
must be set to 2100000 KHz.

For more information about how to use and debug perflock, see [Customize perflock](https://docs.qualcomm.com/doc/80-70029-10/topic/18-customize.html#customize-perlocks).

## Memory

RAM is used for all memory allocations made by Qualcomm Linux. RAM must be managed to meet performance requirements and ensure smooth application behavior. The following figure shows memory partitioning:

<!--?xml version="1.0" encoding="UTF-8"?-->
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="600" height="342.89" viewbox="0 0 600 342.89" aria-label="This figure shows memory partitioning in systems supporting both Linux and non-Linux environments.">
  <defs>
    <style>.svg-1 .cls-1 { letter-spacing: -.01em }
.svg-1 .cls-2 { fill: #007884 }
.svg-1 .cls-3 { letter-spacing: 0em }
.svg-1 .cls-4 { stroke-dasharray: 5.03 5.03 }
.svg-1 .cls-4,.svg-1 .cls-5,.svg-1 .cls-6 { fill: none; stroke: #7c8aa3; stroke-miterlimit: 10 }
.svg-1 .cls-7 { letter-spacing: 0em }
.svg-1 .cls-8 { fill: #d2d7e1 }
.svg-1 .cls-9 { letter-spacing: 0em }
.svg-1 .cls-5 { stroke-dasharray: 5 }
.svg-1 .cls-10 { font-family: RobotoFlex-Bold, "Roboto Flex"; font-size: 18px; font-variation-settings: "opsz" 14, "wght" 700, "GRAD" 0, "wdth" 100, "slnt" 0, "XOPQ" 96, "YOPQ" 79, "XTRA" 468, "YTUC" 712, "YTLC" 514, "YTAS" 750, "YTDE" -203, "YTFI" 738; font-weight: 700 }
.svg-1 .cls-11 { letter-spacing: 0em }
.svg-1 .cls-12 { fill: #fff; font-family: RobotoFlex-Regular, "Roboto Flex"; font-variation-settings: "opsz" 14, "wght" 400, "GRAD" 0, "wdth" 100, "slnt" 0, "XOPQ" 96, "YOPQ" 79, "XTRA" 468, "YTUC" 712, "YTLC" 514, "YTAS" 750, "YTDE" -203, "YTFI" 738 }
.svg-1 .cls-12,.svg-1 .cls-13 { font-size: 16px }
.svg-1 .cls-14 { fill: #fafafa }
.svg-1 .cls-13 { font-family: RobotoFlex-Medium, "Roboto Flex"; font-variation-settings: "opsz" 14, "wght" 500, "GRAD" 0, "wdth" 100, "slnt" 0, "XOPQ" 96, "YOPQ" 79, "XTRA" 468, "YTUC" 712, "YTLC" 514, "YTAS" 750, "YTDE" -203, "YTFI" 738; font-weight: 500 }</style>
  </defs>
  <g>
    <rect class="cls-14" x=".5" y=".5" width="599" height="341.89" rx="7.5" ry="7.5"></rect>
    <path class="cls-8" d="M592,1c3.86,0,7,3.14,7,7v326.89c0,3.86-3.14,7-7,7H8c-3.86,0-7-3.14-7-7V8c0-3.86,3.14-7,7-7h584M592,0H8C3.58,0,0,3.58,0,8v326.89c0,4.42,3.58,8,8,8h584c4.42,0,8-3.58,8-8V8c0-4.42-3.58-8-8-8h0Z"></path>
  </g>
  <rect class="cls-2" x="44.29" y="65.63" width="140.17" height="201.22" rx="4" ry="4"></rect>
  <rect class="cls-2" x="243.32" y="99.2" width="148.86" height="75.98" rx="4" ry="4"></rect>
  <rect class="cls-2" x="406.8" y="99.2" width="148.86" height="75.98" rx="4" ry="4"></rect>
  <rect class="cls-2" x="243.32" y="190.87" width="148.86" height="75.98" rx="4" ry="4"></rect>
  <rect class="cls-2" x="406.8" y="190.87" width="148.86" height="75.98" rx="4" ry="4"></rect>
  <rect class="cls-5" x="15.01" y="36.39" width="569.97" height="291.53" rx="4" ry="4"></rect>
  <g>
    <line class="cls-6" x1="213.76" y1="36.39" x2="213.76" y2="38.89"></line>
    <line class="cls-4" x1="213.76" y1="43.92" x2="213.76" y2="322.9"></line>
    <line class="cls-6" x1="213.76" y1="325.42" x2="213.76" y2="327.92"></line>
  </g>
  <text class="cls-10" transform="translate(544.81 28.28)"><tspan x="0" y="0">RAM</tspan></text>
  <text class="cls-13" transform="translate(299.03 80.47)"><tspan x="0" y="0">Memo</tspan><tspan class="cls-11" x="46.12" y="0">r</tspan><tspan x="51.84" y="0">y </tspan><tspan class="cls-7" x="63.41" y="0">t</tspan><tspan x="68.43" y="0">otal (system RAM)</tspan></text>
  <text class="cls-12" transform="translate(295.28 131.88)"><tspan class="cls-1" x="0" y="0">K</tspan><tspan x="9.69" y="0">ernel</tspan><tspan x="3" y="19.2">static</tspan></text>
  <text class="cls-12" transform="translate(458.76 131.88)"><tspan class="cls-1" x="0" y="0">K</tspan><tspan x="9.69" y="0">ernel</tspan><tspan x="-7.56" y="19.2">dynamic</tspan></text>
  <text class="cls-12" transform="translate(465.75 223.55)"><tspan class="cls-1" x="0" y="0">F</tspan><tspan class="cls-9" x="8.62" y="0">r</tspan><tspan x="13.95" y="0">ee</tspan><tspan x="-13.58" y="19.2">memo</tspan><tspan class="cls-11" x="31.56" y="19.2">r</tspan><tspan x="37.17" y="19.2">y</tspan></text>
  <text class="cls-12" transform="translate(278.28 223.55)"><tspan x="0" y="0">User space</tspan><tspan x="11.39" y="19.2">p</tspan><tspan class="cls-7" x="20.53" y="19.2">r</tspan><tspan x="25.84" y="19.2">ocess</tspan></text>
  <text class="cls-12" transform="translate(81.8 171.29)"><tspan x="0" y="0">Rese</tspan><tspan class="cls-11" x="34.66" y="0">r</tspan><tspan class="cls-3" x="40.27" y="0">v</tspan><tspan x="47.52" y="0">ed</tspan></text>
  <text class="cls-13" transform="translate(243.32 313.14)"><tspan x="0" y="0">Linux</tspan></text>
  <text class="cls-13" transform="translate(106.7 313.14)"><tspan x="0" y="0">Non-Linux</tspan></text>
</svg>

**Figure : Memory partitioning**

The figure shows RAM allocation in systems supporting both Linux and non-Linux environments.

- System RAM is partitioned between non-Linux and Linux components.
- Non-Linux section includes a large block labeled Reserved, indicating memory allocated for non-Linux operations.
- Linux section is divided into four blocks under Memory total (system RAM):

    - Kernel static
    - Kernel dynamic
    - Userspace process
    - Free memory

Certain sections of RAM are managed independent of the Linux system. For
example, firmware such as modem, video, and audio run from these
specific RAM partitions. The Linux kernel manages all other RAM
partitions.

The Linux kernel features its own memory management subsystem, which
includes:

- Implementation of virtual memory and demand paging
- Allocation of memory to both kernel internal structures and userspace programs
- Mapping of files into the address space of the processes
- Other memory management operations

### RAM memory partitioning

The following table describes various types of memory allocations.

Note

The commands specified in the following table should be run on the device.

| RAM classification | Memory segment | Allocation types | Description |
| --- | --- | --- | --- |
| Non-Linux | None | None | <ul class="simple"><br><li><p>Memory is reserved in the form of carveouts by various<br>subsystems other than Linux.</p></li><br><li><p>These carveouts are specified in the respective DTSI<br>files.</p></li><br></ul> |
| Linux (system RAM) | Kernel static | Vmlinux + kernel page structures | <ul><br><li><p>The kernel reserves this memory at boot time for its own<br>usage.</p></li><br><li><p>Vmlinux is the memory used to store the vmlinux image.</p></li><br><li><p>The size and breakdown of the vmlinux image can be<br>obtained from the <code class="docutils literal notranslate"><span class="pre">dmesg</span></code> logs at boot:</p><br><blockquote><br><div><p>Memory: 3061872K/4134912K available (28800K kernel code, 2090K rwdata, 10688K rodata, 3072K init, 969K bss, 679824K reserved, 393216K cma-reserved)</p><br><p>Kernel code + rwdata + rodata + init +bss indicates vmlinux kernel image size (28800k + 2090k + 10688k + 3072k + 969k)</p><br></div></blockquote><br></li><br><li><p>The kernel page structure is the memory used by the<br>kernel to maintain page structures for every page of RAM.<br>This is calculated as 16&nbsp;MB per GB of RAM size.</p></li><br></ul> |
| Linux (system RAM) | Kernel dynamic | Slab | <ul class="simple"><br><li><p>The slab is used by the kernel for faster and more<br>efficient memory usage of frequently used data<br>structures.</p></li><br><li><p>To check the memory usage of the slab, run the following<br>command:</p></li><br></ul><br><br>cat /proc/meminfo | grep -i slab<br>    Copy to clipboard<br><ul class="simple"><br><li><p>To view the breakdown of various slabs and their<br>usage, enable <code class="docutils literal notranslate"><span class="pre">CONFIG_SLUB_DEBUG</span></code> in the kernel<br>configuration, and then run the following command:</p></li><br></ul><br><br>cat /proc/slabinfo<br>    Copy to clipboard |
| Linux (system RAM) | Kernel dynamic | Kernel stack | <ul class="simple"><br><li><p>The kernel stack stores the call stack of every process.</p></li><br><li><p>To check the memory usage of the kernel stack, run the<br>following command:</p></li><br></ul><br><br>cat /proc/meminfo | grep -i kernelstack<br>    Copy to clipboard |
| Linux (system RAM) | Kernel dynamic | PageTables | <ul class="simple"><br><li><p>The kernel uses memory to store PageTables that map<br>virtual addresses to physical addresses.</p></li><br><li><p>To check the memory usage of PageTables, run the<br>following command:</p></li><br></ul><br><br>cat /proc/meminfo | grep -i PageTables<br>    Copy to clipboard |
| Linux (system RAM) | Kernel dynamic | Modules | <ul class="simple"><br><li><p>Represents the kernel entities that are dynamically<br>loaded into the kernel in the form of kernel modules.</p></li><br><li><p>To display the list of loaded kernel modules and their<br>memory usage, run the following command:</p></li><br></ul><br><br>cat /proc/modules<br>    Copy to clipboard |
| Linux (system RAM) | Kernel dynamic | Vmalloc | <ul class="simple"><br><li><p>Used to allocate contiguous memory.</p></li><br><li><p>To check the Vmalloc memory breakup, run the following command:</p></li><br></ul><br><br>cat /proc/vmallocinfo<br>    Copy to clipboard |
| Linux (system RAM) | Kernel dynamic | Cached (kernel + userspace) | <ul class="simple"><br><li><p>The amount of file-backed memory that resides in RAM.</p></li><br><li><p>To check the cached memory usage, run the following<br>command:</p></li><br></ul><br><br>cat /proc/meminfo | grep -i cached<br>    Copy to clipboard |
| Linux (system RAM) | Kernel dynamic | Buffers | <ul class="simple"><br><li><p>Buffers are of fixed size and contain blocks of<br>information either read from disk or written to disk.</p></li><br><li><p>To check the buffer memory usage, run the following<br>command:</p></li><br></ul><br><br>cat /proc/meminfo | grep -i Buffers<br>    Copy to clipboard |
| Linux (system RAM) | Kernel dynamic | Shmem | <ul class="simple"><br><li><p>Shared memory is a common block of memory that's mapped<br>into the address spaces of two or more processes.</p></li><br><li><p>To check the shared memory usage, run the following<br>command:</p></li><br></ul><br><br>cat /proc/meminfo | grep -i shmem<br>    Copy to clipboard |
| Linux (system RAM) | Userspace | ZUSED (ZRAM) | An anonymous memory post compression by ZRAM. |
| Linux (system RAM) | Userspace | CMA | <ul class="simple"><br><li><p>A contiguous physical memory is typically mapped to<br>other IPs such as video and display. However, it's<br>allocated to the runtime.</p></li><br><li><p>The free memory that the system can use is reduced with<br>the usage of more CMA reservations. Only the movable<br>allocations, such as userspace process allocations can<br>use the CMA reserved free memory. However, it can't be<br>used for the kernel allocations.</p></li><br></ul> |
| Linux (system RAM) | Userspace | ANON | <ul class="simple"><br><li><p>Memory that userspace applications allocate using<br><code class="docutils literal notranslate"><span class="pre">malloc()</span></code> or <code class="docutils literal notranslate"><span class="pre">new()</span></code> function calls.</p></li><br><li><p>To check the ANON memory breakup for a process, run the<br>following command:</p></li><br></ul><br><br><br>> <br>> <br>> cat /proc/<pid>/smaps<br>>     Copy to clipboard |
| Linux (system RAM) | Userspace | ION | <ul class="simple"><br><li><p>ION memory allows sharing buffers between hardware IPs<br>such as video, camera, and Qualcomm Linux.</p></li><br><li><p>ION manages one or more memory pools, which can be set<br>aside at boot time to combat fragmentation.</p></li><br><li><p>To check the ION memory usage, run the following<br>commands:</p></li><br></ul><br><br>mount -t debugfs none /sys/kernel/debug<br>    Copy to clipboard<br><br><br>cat /sys/kernel/debug/dma_buf/bufinfo | grep bytes<br>    Copy to clipboard |
| Linux (system RAM) | Userspace | KGSL | <ul class="simple"><br><li><p>Memory allocated by the graphics driver.</p></li><br><li><p>To check the overall kernel graphics support layer (KGSL)<br>memory usage, run the following command:</p></li><br></ul><br><br><br>> <br>> <br>> cat /sys/class/kgsl/kgsl/page_alloc<br>>     Copy to clipboard<br><br><ul class="simple"><br><li><p>To check the process level breakup, run the following<br>command:</p></li><br></ul><br><br><br>> <br>> <br>> cat /sys/class/kgsl/kgsl/proc/<pid>/kernel<br>>     Copy to clipboard |
| Linux (system RAM) | Free memory | None | <ul><br><li><p>Free memory is the memory that's not yet used and is<br>available for any allocation.</p></li><br><li><p>To check the available memory, run the following command:</p><br><div class="highlight-default notranslate"><div class="highlight"><pre class="pre codeblock"><code>cat /proc/meminfo | grep -i MemFree<br></code><span class="copyclip"><svg xmlns="http://www.w3.org/2000/svg" class="copyclipicon" width="25px" height="25px" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect><title>Copy to clipboard</title><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg></span></pre></div><br></div><br></li><br></ul> |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |
|  |  |  |  |

## Real-time kernel

[Real-time (RT) Linux](https://realtime-linux.org/) isn't enabled by
default on Qualcomm Linux. You can enable RT Linux based on the product
requirements.

RT Linux is designed to offer deterministic and predictable behavior for
applications that are time‑sensitive.

### Set up the workspace

In Qualcomm Linux, the RT Linux kernel recipes are referred to as follows:

- Base BSP: `linux-qcom-base-rt`
- Custom BSP: `linux-qcom-custom-rt`

The Qualcomm Linux kernel supports long-term support (LTS) RT kernel
6.6 version, which is maintained through the Yocto recipe in the
`meta-qcom-realtime` layer in the following paths in the source code:

- Base BSP: `recipes-kernel/linux/linux-kernel-base-rt_6.6.bb`
- Custom BSP: `recipes-kernel/linux/linux-kernel-custom-rt_6.6.bb`

For more information about how to clone the workspace and acquire all the
meta layers to use Qualcomm RT Linux kernel, see [Sync and build with
real-time Linux](https://docs.qualcomm.com/bundle/publicresource/topics/80-70029-254/how_to.html#sync-and-build-with-real-time-linux).

### Enable RT kernel

Use the RT Linux kernel recipe to enable the RT kernel. This recipe
fetches the kernel, downloads pre-empt RT patches, and applies them to
the kernel. It also allows a fully pre-emptible kernel with:

`CONFIG_PREEMPT_RT=y`

For more information, see [Real-time (RT) kernel overview](https://docs.qualcomm.com/bundle/publicresource/topics/80-70029-3/real_time_kernel_overview.html).

### Verify kernel type

After booting, verify the kernel type by running the following command
on the device:

uname -v
    Copy to clipboard

The following is an output of the command:

SMP PREMPT\_RT

### Test RT Linux kernel

See [Test RT kernel](https://docs.qualcomm.com/bundle/publicresource/topics/80-70029-3/real_time_kernel_overview.html#test-rt-kernel) for the test procedure and RT Linux kernel key performance indicators (KPIs).

## Next steps

- [Customize for performance tuning](https://docs.qualcomm.com/doc/80-70029-10/topic/18-customize.html#customize)
- [Analyze performance with tools](https://docs.qualcomm.com/doc/80-70029-10/topic/13-performance_tools.html#performance-tools)

Last Published: Apr 03, 2026

[Previous Topic
Get started with performance tuning and optimization](https://docs.qualcomm.com/bundle/publicresource/80-70029-10/topics/get-started.md) [Next Topic
Analyze performance with tools](https://docs.qualcomm.com/bundle/publicresource/80-70029-10/topics/13-performance_tools.md)

Source: [https://docs.qualcomm.com/doc/80-70029-10/topic/2-performance-features.html](https://docs.qualcomm.com/doc/80-70029-10/topic/2-performance-features.html)