Revert "sm8350-common: let init do read ahead configuration"

Init doesn't handle all dm devices

This reverts commit 17d09b70a0.

Change-Id: I2b42c286307e8fd41140bca8f893ccdf13ebfc06
This commit is contained in:
Arian 2022-08-28 17:15:32 +02:00
parent 8a5471e402
commit 163cec32a7

View File

@ -77,6 +77,30 @@ function configure_zram_parameters() {
fi
}
function configure_read_ahead_kb_values() {
MemTotalStr=`cat /proc/meminfo | grep MemTotal`
MemTotal=${MemTotalStr:16:8}
dmpts=$(ls /sys/block/*/queue/read_ahead_kb | grep -e dm -e mmc)
# Set 128 for <= 3GB &
# set 512 for >= 4GB targets.
if [ $MemTotal -le 3145728 ]; then
ra_kb=128
else
ra_kb=512
fi
if [ -f /sys/block/mmcblk0/bdi/read_ahead_kb ]; then
echo $ra_kb > /sys/block/mmcblk0/bdi/read_ahead_kb
fi
if [ -f /sys/block/mmcblk0rpmb/bdi/read_ahead_kb ]; then
echo $ra_kb > /sys/block/mmcblk0rpmb/bdi/read_ahead_kb
fi
for dm in $dmpts; do
echo $ra_kb > $dm
done
}
function configure_memory_parameters() {
# Set Memory parameters.
#
@ -98,6 +122,7 @@ function configure_memory_parameters() {
#
configure_zram_parameters
configure_read_ahead_kb_values
echo 0 > /proc/sys/vm/page-cluster
echo 100 > /proc/sys/vm/swappiness
echo 1 > /proc/sys/vm/watermark_scale_factor