Randall Huang cbd27f8900
sm6250-common: remove IO read_ahead_kb tune
If we set 2048KB ra value in the beginning of the
boot process, services initialized at this time would
keep 2048KB ra value even though we adjust the ra value
to 128KB after boot completion.

This may cause memory pressure.

Bug: 174700194
Signed-off-by: Randall Huang <huangrandall@google.com>
Change-Id: I97ee0ee9511eaada011f2634afd68d68cdca4570
2022-05-17 13:27:32 +00:00

221 lines
8.4 KiB
Plaintext

# Copyright (c) 2013-2018,2020, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
on early-init
# configure governor settings
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor schedutil
write /sys/devices/system/cpu/cpu0/cpufreq/schedutil/up_rate_limit_us 500
write /sys/devices/system/cpu/cpu0/cpufreq/schedutil/down_rate_limit_us 20000
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 576000
# configure governor settings for big cluster
write /sys/devices/system/cpu/cpu6/cpufreq/scaling_governor schedutil
write /sys/devices/system/cpu/cpu6/cpufreq/schedutil/up_rate_limit_us 500
write /sys/devices/system/cpu/cpu6/cpufreq/schedutil/down_rate_limit_us 20000
write /sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq 652800
on init
write /sys/module/qpnp_rtc/parameters/poweron_alarm 1
wait /dev/block/platform/soc/${ro.boot.bootdevice}
symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
# Disable UFS powersaving
write /sys/devices/platform/soc/${ro.boot.bootdevice}/clkgate_enable 0
# Boot time cpuset and stune
write /dev/cpuset/top-app/cpus 0-7
write /dev/cpuset/foreground/cpus 0-7
write /dev/cpuset/background/cpus 0-5
write /dev/cpuset/system-background/cpus 0-5
write /dev/cpuset/restricted/cpus 2-5
write /dev/stune/foreground/schedtune.prefer_idle 1
write /dev/stune/foreground/schedtune.prefer_high_cap 1
write /dev/stune/foreground/schedtune.boost 100
write /dev/stune/schedtune.prefer_idle 1
write /dev/stune/schedtune.prefer_high_cap 1
write /dev/stune/schedtune.boost 100
write /dev/stune/top-app/schedtune.prefer_idle 1
write /dev/stune/top-app/schedtune.prefer_high_cap 1
write /dev/stune/top-app/schedtune.boost 100
mkdir /dev/cpuset/camera-daemon
write /dev/cpuset/camera-daemon/cpus 0-7
write /dev/cpuset/camera-daemon/mems 0
chown cameraserver cameraserver /dev/cpuset/camera-daemon
chown cameraserver cameraserver /dev/cpuset/camera-daemon/tasks
chmod 0660 /dev/cpuset/camera-daemon/tasks
on early-fs
start vold
on fs
start hwservicemanager
mount_all --early
chown root system /mnt/vendor/persist
chmod 0771 /mnt/vendor/persist
restorecon_recursive /mnt/vendor/persist
mkdir /mnt/vendor/persist/data 0700 system system
mkdir /mnt/vendor/persist/subsys 0770 root system
mkdir /mnt/vendor/persist/audio 0755 system system
mkdir /mnt/vendor/persist/haptics 0755 system system
on post-fs
write /dev/ipa 1
on late-fs
wait_for_prop hwservicemanager.ready true
exec_start wait_for_keymaster
mount_all --late
on post-fs-data
mkdir /data/vendor/touchpad 0775 system system
mkdir /data/vendor/hbtp 0750 system system
mkdir /persist/qti_fp 0700 system system
mkdir /data/vendor/nnhal 0700 system system
mkdir /data/vendor/mac_addr 0771 system system
on boot
chown system system /sys/class/drm/card0-DSI-1/disp_param
chmod 0664 /sys/class/drm/card0-DSI-1/disp_param
chown system system /sys/class/drm/card0-DSI-1/mipi_reg
chmod 0664 /sys/class/drm/card0-DSI-1/mipi_reg
chown system system /sys/class/drm/card0-DSI-1/panel_info
chmod 0444 /sys/class/drm/card0-DSI-1/panel_info
chown system system /sys/kernel/hbtp/display_pwr
start rmt_storage
start rfs_access
chmod 0666 sys/devices/platform/soc/890000.i2c/i2c-1/1-005a/cali
chmod 0666 sys/devices/platform/soc/890000.i2c/i2c-1/1-005a/cali_save
chmod 0666 sys/devices/platform/soc/890000.i2c/i2c-1/1-005a/f0_save
chmod 0666 sys/devices/platform/soc/890000.i2c/i2c-1/1-005a/osc_save
chmod 0666 sys/devices/platform/soc/890000.i2c/i2c-1/1-005a/osc_cali
# access permissions for fingerprint
chown system system /sys/bus/platform/devices/soc/soc:fpc1020/irq
chown system system /sys/bus/platform/devices/soc/soc:fpc1020/wakeup_enable
chown system system /sys/bus/platform/devices/soc/soc:fpc1020/modalias
chmod 0666 /dev/qseecom
chmod 0644 /dev/goodix_fp
chown system system /dev/goodix_fp
#USB controller configuration
setprop vendor.usb.rndis.func.name "gsi"
setprop vendor.usb.rmnet.func.name "gsi"
setprop vendor.usb.rmnet.inst.name "rmnet"
setprop vendor.usb.dpl.inst.name "dpl"
setprop vendor.usb.qdss.inst.name "qdss"
setprop vendor.usb.controller a600000.dwc3
#pd-mapper
service vendor.pd_mapper /vendor/bin/pd-mapper
class core
user system
group system
#Peripheral manager
service vendor.per_mgr /vendor/bin/pm-service
class core
user system
group system
ioprio rt 4
service vendor.per_proxy /vendor/bin/pm-proxy
class core
user system
group system
disabled
service vendor.thermal-engine /vendor/bin/thermal-engine -c /vendor/etc/thermal-engine-${ro.boot.hwname}.conf
class main
user root
group root
on property:init.svc.vendor.per_mgr=running
start vendor.per_proxy
on property:sys.shutdown.requested=*
stop vendor.per_proxy
on charger
mkdir /mnt/vendor/persist
chown root system /mnt/vendor/persist
chmod 0771 /mnt/vendor/persist
mkdir /mnt/vendor/persist/subsys 0770 root system
setprop sys.usb.controller a600000.dwc3
setprop sys.usb.configfs 1
chown system system /sys/class/leds/red/brightness
chmod 0666 /sys/class/leds/red/brightness
chmod 0666 /sys/class/backlight/panel0-backlight/brightness
start vendor.power_off_alarm
on property:sys.boot_completed=1
# Read only one page at a time
write /proc/sys/vm/page-cluster 0
# Swap more aggressively
write /proc/sys/vm/swappiness 100
# Set zRAM compression algorithm to LZ4
write /sys/block/zram0/comp_algorithm lz4
# Enable zRAM data deduplication feature
write /sys/block/zram0/use_dedup 1
# Mount swap partitions specified in fstab
swapon_all /vendor/etc/fstab.qcom
# Back to default VM settings
write /proc/sys/vm/dirty_expire_centisecs 3000
write /proc/sys/vm/dirty_background_ratio 10
# Setup runtime cpusets
write /dev/cpuset/top-app/cpus 0-7
write /dev/cpuset/foreground/cpus 0-5,7
write /dev/cpuset/background/cpus 4-5
write /dev/cpuset/system-background/cpus 2-5
write /dev/cpuset/restricted/cpus 2-5
# Setup runtime schedTune
write /dev/stune/foreground/schedtune.prefer_idle 1
write /dev/stune/foreground/schedtune.prefer_high_cap 0
write /dev/stune/foreground/schedtune.boost 0
write /dev/stune/schedtune.prefer_idle 0
write /dev/stune/schedtune.prefer_high_cap 0
write /dev/stune/schedtune.boost 0
write /dev/stune/top-app/schedtune.prefer_idle 1
write /dev/stune/top-app/schedtune.prefer_high_cap 0
write /dev/stune/top-app/schedtune.boost 10
# Setup runtime blkio
# value for group_idle is us
write /dev/blkio/blkio.weight 1000
write /dev/blkio/background/blkio.weight 200
write /dev/blkio/blkio.group_idle 2000
write /dev/blkio/background/blkio.group_idle 0
on property:ro.boot.multisim_config=*
setprop persist.radio.multisim.config ${ro.boot.multisim_config}