Configure CPU
You can check and modify the CPU configurations using the commands specified in the following table:The commands specified in the following table should be run on the device. The unit of the output value for these commands is in KHz.
The commands containing
policy7 aren’t supported on QCS5430 FP1.- Qualcomm Linux Performance Guide - Addendum for Qualcomm Dragonwing IQ-9075
- Qualcomm Linux Performance Guide - Addendum for Qualcomm Dragonwing IQ-8275
| Command | Purpose |
|---|---|
cat /sys/devices/system/cpu/online | Checks the online CPU cores. |
echo 1 > /sys/devices/system/cpu/cpuX/online | Turns on a CPU core. In cpuX, X represents the number of cores, which ranges from 0 to 7. |
echo 0 > /sys/devices/system/cpu/cpuX/online | Turns off a CPU core. In cpuX, X represents the number of cores, which ranges from 0 to 7. |
cat /sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freqcat /sys/devices/system/cpu/cpufreq/policy4/scaling_cur_freqcat /sys/devices/system/cpu/cpufreq/policy7/scaling_cur_freq | Reads the current CPU frequency. |
cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequenciescat /sys/devices/system/cpu/cpufreq/policy4/scaling_available_frequenciescat /sys/devices/system/cpu/cpufreq/policy7/scaling_available_frequencies | Reads the supported CPU frequencies. |
cat /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freqcat /sys/devices/system/cpu/cpufreq/policy4/scaling_min_freqcat /sys/devices/system/cpu/cpufreq/policy7/scaling_min_freq | Reads the minimum CPU frequency. |
echo <cpu freq in KHz> > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freqecho <cpu freq in KHz> > /sys/devices/system/cpu/cpufreq/policy4/scaling_min_freqecho <cpu freq in KHz> > /sys/devices/system/cpu/cpufreq/policy7/scaling_min_freq | Sets the minimum CPU frequency. Replace <cpu freq in KHz> with the required frequency and run the commands. |
cat /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freqcat /sys/devices/system/cpu/cpufreq/policy4/scaling_max_freqcat /sys/devices/system/cpu/cpufreq/policy7/scaling_max_freq | Reads the maximum CPU frequency. |
echo <cpu freq in KHz> > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freqecho <cpu freq in KHz> > /sys/devices/system/cpu/cpufreq/policy4/scaling_max_freqecho <cpu freq in KHz> > /sys/devices/system/cpu/cpufreq/policy7/scaling_max_freq | Sets the maximum CPU frequency. Replace <cpu freq in KHz> with the required frequency and run the commands. |
cat /sys/devices/system/cpu/cpufreq/policy0/stats/trans_tablecat /sys/devices/system/cpu/cpufreq/policy4/stats/trans_tablecat /sys/devices/system/cpu/cpufreq/policy7/stats/trans_table | Checks the CPU residency. |
For example, to set the CPU frequency of the Silver core at 1.5 GHz, run the following commands: echo 1516800 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freqecho 1516800 > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq | Sets the CPU frequency. Set scaling_min_freq and scaling_max_freq to the same frequency to keep the CPU frequency at the required level. |
| Command | Purpose |
|---|---|
cat /sys/devices/system/cpu/online | Checks the online CPU cores. |
echo 1 > /sys/devices/system/cpu/cpuX/online | Turns on a CPU core. In cpuX, X represents the number of cores, which ranges from 0 to 7. |
echo 0 > /sys/devices/system/cpu/cpuX/online | Turns off a CPU core. In cpuX, X represents the number of cores, which ranges from 0 to 7. |
cat /sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freqcat /sys/devices/system/cpu/cpufreq/policy6/scaling_cur_freq | Reads the current frequency of the CPU. |
cat /sys/devices/system/cpu/cpufreq/policy0/scaling_available_frequenciescat /sys/devices/system/cpu/cpufreq/policy6/scaling_available_frequencies | Reads the supported frequencies of the CPU. |
cat /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freqcat /sys/devices/system/cpu/cpufreq/policy6/scaling_min_freq | Reads the minimum frequency of the CPU. |
echo <cpu freq in KHz> > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freqecho <cpu freq in KHz> > /sys/devices/system/cpu/cpufreq/policy6/scaling_min_freq | Sets the minimum frequency of the CPU. Replace <cpu freq in KHz> with the required frequency and run the commands. |
cat /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freqcat /sys/devices/system/cpu/cpufreq/policy6/scaling_max_freq | Reads the maximum frequency of the CPU. |
echo <cpu freq in KHz> > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freqecho <cpu freq in KHz> > /sys/devices/system/cpu/cpufreq/policy6/scaling_max_freq | To set the maximum frequency of the CPU, replace <cpu freq in KHz> with the required frequency and run the commands. |
cat /sys/devices/system/cpu/cpufreq/policy0/stats/trans_tablecat /sys/devices/system/cpu/cpufreq/policy6/stats/trans_table | Checks the CPU residency. |
For example, to set the CPU frequency of the Silver core at 1.5 GHz, run the following commands:echo 1516800 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freqecho 1516800 > /sys/devices/system/cpu/cpufreq/policy0/scaling_max_freq | To set the CPU frequency at a required level, both scaling_min_freq and scaling_max_freq should be set to the same frequency. |
Configure GPU
You can check and modify the GPU configurations on the device using the commands specified in the following table:The commands specified in the following table should be run on the device. The unit of the output value for these commands is in Hz.
| Command | Purpose |
|---|---|
cat /sys/class/kgsl/kgsl-3d0/gpuclk | Reads the current GPU frequency. |
cat /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies | Reads the supported GPU frequencies. |
cat /sys/class/kgsl/kgsl-3d0/devfreq/min_freq | Reads the minimum GPU frequency. |
echo <GPU freq in Hz> > /sys/class/kgsl/kgsl-3d0/devfreq/min_freq | Sets the minimum GPU frequency. Replace <GPU freq in Hz> with the required frequency in Hz and run the command. |
cat /sys/class/kgsl/kgsl-3d0/devfreq/max_freq | Reads the maximum GPU frequency. |
echo <GPU freq in Hz> /sys/class/kgsl/kgsl-3d0/devfreq/max_freq | Sets the maximum GPU frequency. Replace <GPU freq in Hz> with the required frequency in Hz and run the command. |
cat /sys/class/kgsl/kgsl-3d0/gpu_busy_percentage | Reads the GPU percentage usage. |
For example, to set the GPU frequency at 600000000 Hz, run the following commands:echo 600000000 > /sys/class/kgsl/kgsl-3d0/devfreq/min_freqecho 600000000 > /sys/class/kgsl/kgsl-3d0/devfreq/max_freq | Sets the GPU frequency at a required level; both min_freq and max_freq should be set to the same frequency level. |
cat /sys/class/kgsl/kgsl-3d0/max_pwrlevelcat /sys/class/kgsl/kgsl-3d0/min_pwrlevel | Reads the GPU power levels. Power level 0 corresponds to the maximum GPU clock frequency. As the power level value increases, the GPU clock frequency decreases. |
echo 0 > /sys/class/kgsl/kgsl-3d0/min_pwrlevel | Sets the GPU frequency to maximum frequency. |
Configure memory
Memory configuration is crucial to conserve memory, make space available for processes, and balance the existing data in RAM when the physical memory reaches its limits.Set ZRAM disk size
ZRAM is a RAM partition to swap memory space. It stores the inactive anonymous pages in a compressed form in RAM to conserve memory. The ZRAM disk size indicates the maximum amount of memory that can be swapped from RAM to ZRAM. It’s recommended to set the ZRAM disk size to half the size of RAM. ZRAM is enabled by default in the Qualcomm® Linux® build. By default, 50% of RAM is configured as the ZRAM memory limit using the/sys/block/zram*/mem_limit parameter in the post_boot_common.sh script.
To reconfigure the ZRAM memory limit, modify the /sys/block/zram*/mem_limit parameter value in the post_boot_common.sh script located at /etc/urm/initscripts/post_boot/ on the device.
For more information about the post-boot scripts, see Post-boot init scripts.
Enable/disable proactive compaction
Compaction is a process that collects all the free memory spaces in the form of fragments into a large memory block. Proactive compaction determines the level of aggressiveness with which memory compaction happens in the background. It accepts a value between 0 and 100, with the default value set to 20. When the fragmentation score of the node exceeds a high threshold, the corresponding kcompactd thread initiates the proactive compaction process. The compaction process remains active until the score of the node falls below the low threshold. The thresholds for proactive compaction are as follows:- Low = 100 - proactiveness
- High = low + 10%
Swappiness
Swap space is a secondary storage that functions similar to the main memory or RAM. The primary parameter of swap space is swappiness.- This parameter determines how aggressively the kernel swap daemon (kswapd) swaps out anonymous memory relative to the system page cache.
- This parameter can take a value between 0 and 200. Increasing the value augments the amount of anonymous swapping. The configured value is 100, indicating that both anonymous and cache memories are reclaimed equally.

