sm8350-common: let init do read ahead configuration
This commit is contained in:
parent
2ce0cf9bfa
commit
17d09b70a0
@ -77,30 +77,6 @@ function configure_zram_parameters() {
|
|||||||
fi
|
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() {
|
function configure_memory_parameters() {
|
||||||
# Set Memory parameters.
|
# Set Memory parameters.
|
||||||
#
|
#
|
||||||
@ -122,7 +98,6 @@ function configure_memory_parameters() {
|
|||||||
#
|
#
|
||||||
|
|
||||||
configure_zram_parameters
|
configure_zram_parameters
|
||||||
configure_read_ahead_kb_values
|
|
||||||
echo 0 > /proc/sys/vm/page-cluster
|
echo 0 > /proc/sys/vm/page-cluster
|
||||||
echo 100 > /proc/sys/vm/swappiness
|
echo 100 > /proc/sys/vm/swappiness
|
||||||
echo 1 > /proc/sys/vm/watermark_scale_factor
|
echo 1 > /proc/sys/vm/watermark_scale_factor
|
||||||
|
Loading…
Reference in New Issue
Block a user