android_device_xiaomi_sdm66.../rootdir/etc/init.qcom.power.rc
johnmart19 b40ca5227c sdm660-common: rootdir: Clean part of Unexported properties
This properties are unused for our purposes, so let's remove it to do not trigger Selinux spam

Signed-off-by: pix106 <sbordenave@gmail.com>
2022-12-27 07:34:56 +01:00

96 lines
4 KiB
Text

# Copyright (c) 2012-2013, 2016-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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 enable-low-power
# Enable PowerHAL hint processing
setprop vendor.powerhal.init 1
on property:sys.boot_completed=1
trigger enable-low-power
# Runtime fs tuning
write /sys/block/sda/queue/nr_requests 128
write /sys/block/sda/queue/iostats 1
# Block layer tuning: discard chunk size up to 128MB
# Otherwise, contiguous discards can be merged
write /sys/block/sda/queue/discard_max_bytes 134217728
# 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-3,5-6
write /dev/cpuset/background/cpus 0-1
write /dev/cpuset/system-background/cpus 0-3
write /dev/cpuset/restricted/cpus 0-3
# 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 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
on init
# 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
# Boot time fs tuning
write /sys/block/sda/queue/iostats 0
write /sys/block/sda/queue/scheduler cfq
write /sys/block/sda/queue/iosched/slice_idle 0
write /sys/block/sda/queue/nr_requests 256
# Disable powersaving
write /sys/module/lpm_levels/parameters/sleep_disabled 1
# bring back all cores
write /sys/devices/system/cpu/cpu0/online 1
write /sys/devices/system/cpu/cpu1/online 1
write /sys/devices/system/cpu/cpu2/online 1
write /sys/devices/system/cpu/cpu3/online 1
write /sys/devices/system/cpu/cpu4/online 1
write /sys/devices/system/cpu/cpu5/online 1
write /sys/devices/system/cpu/cpu6/online 1
write /sys/devices/system/cpu/cpu7/online 1
# report max frequency to unity tasks.
write /proc/sys/kernel/sched_lib_name "UnityMain,libunity.so"
write /proc/sys/kernel/sched_lib_mask_force 255