Remove ZRAM tweaks

Signed-off-by: Tyler Nijmeh <tylernij@gmail.com>
latency
Tyler Nijmeh 4 years ago
parent dab41bcf79
commit f41529ba8d

@ -139,9 +139,6 @@ Allow the scheduler to place tasks on their origin CPU, increasing cache localit
* nr_requests: 128 --> 64: Reduce I/O latencies slightly by reducing the maximum queue depth.
* cfq / kyber: Use a scheduler with balanced scheduling to reduce I/O latencies, which is essential for fast flash storage (eMMC & UFS).
### ZRAM
ZRAM reduces disk wear by reducing disk writes, and also increases cache locality by allowing more data to fit in RAM at once. KTweak configures ZRAM to take up at most half of the available RAM on the system, which is a good ratio of RAM to ZRAM for a mobile device.
# Other Notes
You should know that on Android devices, KTweak applies after init finishes + Android mounts + 120 seconds in order to prevent Android's init from overwriting any values.

@ -45,39 +45,6 @@ write() {
fi
}
# Setup ZRAM to half of the available RAM (sync)
setup_zram() {
local memsize=`cat /proc/meminfo | grep "MemTotal" | awk '{print $2}'`
local halfmemsize="$(($memsize/2))"
modprobe zram &> /dev/null
for device in `find /dev -name "zram*"`
do
local identifier=`echo "$device" | awk -F / '{ print $NF }'`
swapoff "$device"
_write "/sys/block/$identifier/reset" 1
dbg "Disabled ZRAM for $identifier"
done
local avail_algs=`cat /sys/block/zram0/comp_algorithm`
for alg in lz4 zstd lzo deflate
do
if [[ "$avail_algs" == *"$alg"* ]]
then
_write "/sys/block/zram0/comp_algorithm" "$alg"
break
fi
done
_write "/sys/block/zram0/disksize" "${halfmemsize}KB"
local zram0_dev=`find /dev -name "zram0"`
mkswap "$zram0_dev" > /dev/null
swapon "$zram0_dev" > /dev/null
dbg "Configured $halfsizemem KB of ZRAM for zram0"
}
usage() {
echo -n "Usage: `basename $0` [OPTIONS]
Options:
@ -121,9 +88,6 @@ dbg `uname -a`
# CPU boost check
[[ -d "/sys/module/cpu_boost" ]] && dbg "CAF CPU boost detected."
# ZRAM support state
[[ -d "/sys/block/zram0" ]] && dbg "ZRAM supported."
# Kernel
write /proc/sys/kernel/perf_cpu_time_max_percent 5
write /proc/sys/kernel/sched_autogroup_enabled 1
@ -194,7 +158,4 @@ do
write "${queue}nr_requests" 64
done
# ZRAM
[[ -d "/sys/block/zram0" ]] && setup_zram &
exit 0

Loading…
Cancel
Save