mirror of
https://github.com/Evolution-X-Devices/device_xiaomi_sm6150-common
synced 2026-01-27 16:26:02 +00:00
sm6150-common: rootdir: Switch to lmkd
Change-Id: Iaa4ac06f35710231f53adff488c211404bf0cd43 Signed-off-by: Pranav Vashi <neobuddy89@gmail.com> Signed-off-by: therealmharc <therealmharc@gmail.com>
This commit is contained in:
committed by
therealmharc
parent
f489c33789
commit
bd4a67d192
@@ -29,55 +29,6 @@
|
||||
|
||||
target=`getprop ro.board.platform`
|
||||
|
||||
function configure_memory_parameters() {
|
||||
# Set Memory parameters.
|
||||
#
|
||||
# Set per_process_reclaim tuning parameters
|
||||
# All targets will use vmpressure range 50-70,
|
||||
# All targets will use 512 pages swap size.
|
||||
#
|
||||
# Set Low memory killer minfree parameters
|
||||
# 64 bit will use Google default LMK series.
|
||||
#
|
||||
# Set ALMK parameters (usually above the highest minfree values)
|
||||
# vmpressure_file_min threshold is always set slightly higher
|
||||
# than LMK minfree's last bin value for all targets. It is calculated as
|
||||
# vmpressure_file_min = (last bin - second last bin ) + last bin
|
||||
|
||||
# Read adj series and set adj threshold for PPR and ALMK.
|
||||
# This is required since adj values change from framework to framework.
|
||||
adj_series=`cat /sys/module/lowmemorykiller/parameters/adj`
|
||||
adj_1="${adj_series#*,}"
|
||||
set_almk_ppr_adj="${adj_1%%,*}"
|
||||
|
||||
# PPR and ALMK should not act on HOME adj and below.
|
||||
# Normalized ADJ for HOME is 6. Hence multiply by 6
|
||||
# ADJ score represented as INT in LMK params, actual score can be in decimal
|
||||
# Hence add 6 considering a worst case of 0.9 conversion to INT (0.9*6).
|
||||
# For uLMK + Memcg, this will be set as 6 since adj is zero.
|
||||
set_almk_ppr_adj=$(((set_almk_ppr_adj * 6) + 6))
|
||||
echo $set_almk_ppr_adj > /sys/module/lowmemorykiller/parameters/adj_max_shift
|
||||
|
||||
# Calculate vmpressure_file_min as below & set for 64 bit:
|
||||
# vmpressure_file_min = last_lmk_bin + (last_lmk_bin - last_but_one_lmk_bin)
|
||||
minfree_series=`cat /sys/module/lowmemorykiller/parameters/minfree`
|
||||
minfree_1="${minfree_series#*,}" ; rem_minfree_1="${minfree_1%%,*}"
|
||||
minfree_2="${minfree_1#*,}" ; rem_minfree_2="${minfree_2%%,*}"
|
||||
minfree_3="${minfree_2#*,}" ; rem_minfree_3="${minfree_3%%,*}"
|
||||
minfree_4="${minfree_3#*,}" ; rem_minfree_4="${minfree_4%%,*}"
|
||||
minfree_5="${minfree_4#*,}"
|
||||
|
||||
vmpres_file_min=$((minfree_5 + (minfree_5 - rem_minfree_4)))
|
||||
echo $vmpres_file_min > /sys/module/lowmemorykiller/parameters/vmpressure_file_min
|
||||
|
||||
echo "18432,23040,27648,64512,165888,225792" > /sys/module/lowmemorykiller/parameters/minfree
|
||||
|
||||
# Enable adaptive LMK for all targets &
|
||||
# use Google default LMK series for all 64-bit targets >=2GB.
|
||||
echo 1 > /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk
|
||||
echo 1 > /sys/module/lowmemorykiller/parameters/oom_reaper
|
||||
}
|
||||
|
||||
# Apply settings for sm6150
|
||||
# Set the default IRQ affinity to the silver cluster. When a
|
||||
# CPU is isolated/hotplugged, the IRQ affinity is adjusted
|
||||
@@ -114,9 +65,6 @@ case "$soc_id" in
|
||||
echo 10 > /dev/stune/top-app/schedtune.boost
|
||||
echo 1 > /dev/stune/top-app/schedtune.prefer_idle
|
||||
|
||||
# Set Memory parameters
|
||||
configure_memory_parameters
|
||||
|
||||
# Enable bus-dcvs
|
||||
for device in /sys/devices/platform/soc
|
||||
do
|
||||
@@ -215,9 +163,6 @@ case "$soc_id" in
|
||||
echo 10 > /dev/stune/top-app/schedtune.boost
|
||||
echo 1 > /dev/stune/top-app/schedtune.prefer_idle
|
||||
|
||||
# Set Memory parameters
|
||||
configure_memory_parameters
|
||||
|
||||
# Enable bus-dcvs
|
||||
for device in /sys/devices/platform/soc
|
||||
do
|
||||
|
||||
Reference in New Issue
Block a user