Skip to content

Latest commit

 

History

History
133 lines (111 loc) · 14.6 KB

coreinfo.md

File metadata and controls

133 lines (111 loc) · 14.6 KB

Information about applied core tweaks

Here will be a rough "what & why" description for most of the tweaks applied by FDE.AI. All of these tweaks are applied systemlessly, thus are fully revertible. Note that many of the tweaks are dynamically changed via ML while FDE.AI is working in background, depending on device usage scenario. This is only the main part of tunables, there are many more that manipulate low-level hardware stuff and are not described here.
If device has a Qualcomm CPU, this qcom.post_boot script is applied in order to restore OEM kernel parameters before applying any tweaks by FDE.AI.
Last updated: 27/11/2020. Valid for FDE.AI v11+.


FS tweaks:

  • noatime flag (EXT4/F2FS) - to disable inode & directory last update time which increases FS performance
  • commit flag (EXT4) - the sync/flush data to disk period - increased in order to improve performance by caching
  • max_batch_time flag (EXT4) - the period of batch sync operations to disk - increased in order to improve performance by utilizing higher throughput of recent storage chips and better caching utilization
  • init_itable flag (EXT4) - the time to zero out the previous block group's inode table. Increased to minimize the impact on the system performance while file system's inode table is being initialized
  • /sys/module/ext4/parameters/mballoc_debug (EXT4) - disabled (just in case it was ON) to reduce FS debugging overhead & increase performance
  • ram_thresh (F2FS) - controls the memory footprint used by free nids and cached nat entries, increased for better performance
  • cp_interval (F2FS) - controls the checkpoint timing, increased for better performance
  • /proc/sys/fs/dir-notify-enable - used to notify a process about file/directory changes, disabled for better performance
  • /proc/sys/fs/leases-enable;lease-break-time - used to enable or disable file leases on a system-wide basis, enabled/tuned for better performance


IO tweaks:

  • read_ahead_kb - sets the maximum amount of data that the kernel reads ahead for a single file, adaptively tuned to provide better IO performance
  • add_random - the disk entropy contribution, disabled since mobile devices are not using spinning disks
  • iostats - various IO stats, disabled to reduce it's overhead for better performance
  • nomerges - option to disable the lookup logic involved with IO merging requests in the block layer, disabled to reduce it's overhead for better performance
  • rotational - used to stat if the device is of rotational type, obviously disabled
  • rq_affinity - option to change CPU IO task completion behaviour, tuned to utilize CPU caching effects & provide better performance and power saving
  • back_seek_penalty - used by HDDs, reduced since mobile devices are not using spinning disks


Network tweaks:

  • tcp_tw_reuse - the reuse of TIME-WAIT sockets for new connections - enabled
  • tcp_tw_recycle - enables fast recycling of TIME_WAIT sockets, but is known to cause problems when using load balancers - disabled
  • tcp_timestamps - enables TCP packets timestamps - enabled for better unstable connections handling
  • tcp_window_scaling - allows receiving TCP packets larger than defined maximum - enabled for better throughput utilization
  • tcp_slow_start_after_idle - causes communication to start or resume gradually - disabled for possibly faster connection establishment/ping
  • tcp_synack_retries - number of times SYNACKs for a passive TCP connection attempt will be retransmitted - reduced
  • tcp_keepalive_intvl - how frequently the keep-alive connection probes are send out - reduced
  • tcp_keepalive_probes - how many keepalive probes TCP sends out, until it decides that the connection is broken - reduced
  • tcp_fin_timeout - the length of time an orphaned (no longer referenced by any application) connection will remain in the FIN_WAIT_2 state - reduced
  • tcp_challenge_ack_limit - number of challenge ACK sent per second - increased to fix CVE-2016-5696 vulnerability
  • tcp_fastopen - enables TCP Fast Open to send and accept data in the opening SYN packet - enabled to speed up connection with supported servers
  • tcp_default_init_rwnd - set Google's recommended value, which is not set on some older devices


Kernel/VM tweaks:

  • /sys/kernel/debug/tracing/tracing_on - kernel tracing, disabled (just in case it was ON) to reduce it's overhead
  • /proc/sys/kernel/sched_schedstats - kernel scheduler stats, disabled (just in case it was ON) to reduce it's overhead
  • /proc/sys/kernel/perf_cpu_time_max_percent - how much CPU time it should be allowed to use to handle perf sampling events, applied value is automatically calculated depending on device's max CPU frequency
  • /proc/sys/vm/stat_interval - time interval between which vm statistics are updated, increased to reduce it's overhead
  • /proc/sys/kernel/random/... - the kernel entropy pool configuration, slightly tuned to provide better performance, still being powersave
  • /proc/sys/vm/min_free_kbytes;extra_free_kbytes - used to force the VM to keep a minimum number of kilobytes free, tuned to provide better performance
  • /proc/sys/vm/reap_mem_on_sigkill - enables or disables panic on out-of-memory feature, disabled for stability.
  • /proc/sys/vm/block_dump - used for I/O debugging, disabled (just in case it was ON) for better performance
  • /proc/sys/vm/oom_dump_tasks - enables a system-wide task dump on OOM, disabled to reduce it's overhead for better performance
  • /proc/sys/vm/compact_memory - toggles memory compaction to keep more available RAM, enabled for better performance
  • /proc/sys/vm/page-cluster - the swap counterpart to page cache readahead, tuned for better performance
  • /proc/sys/vm/laptop_mode - the dirty cache utilisation logic, dynamically changed by ML to provide balanced powersave & performance UX
  • /proc/sys/kernel/hung_task_timeout_secs - checks for hanged tasks, disabled to reduce it's overhead for better performance
  • /sys/kernel/power_suspend/power_suspend_mode - kernel power suspend management, tuned for better powersaving
  • /proc/sys/kernel/sched_walt_init_task_load_pct;sched_walt_rotate_big_tasks - EAS tunables, optimized to provide better performance, still being powersave
  • /proc/sys/kernel/sched_tunable_scaling - controls whether the scheduler can adjust sched_latency_ns, disabled for stability
  • /proc/sys/kernel/sched_enable_power_aware;sched_cfs_boost;sched_mc_power_savings;sched_smt_power_savings;power_aware_timer_migration;/sys/module/workqueue/parameters/power_efficient - nodes to toggle load balancing logic for multi-core CPUs, dynamically changed by ML to provide balanced powersave & performance UX
  • /proc/sys/kernel/sched_ravg_hist_size - controls the number of samples for determination of its demand, tuned for better performance
  • /dev/stune/... - EAS related tunables, dynamically changed by ML to provide balanced powersave & performance UX
  • /sys/kernel/mm/ksm;uksm/... - a memory-saving de-duplication feature for low RAM devices, saves a bit of RAM but does extra CPU loads, enabled and tuned for better performance ol low RAM devices
  • /proc/sys/vm/vfs_cache_pressure - controls the tendency of the kernel to reclaim the memory for caching of directory and inode objects, dynamically changed by ML to provide balanced powersave & performance UX
  • /proc/sys/vm/dirty_writeback_centisecs - the kernel dirty data flusher interval, dynamically changed by ML to provide balanced powersave & performance UX
  • /proc/sys/vm/dirty_expire_centisecs - period when dirty data is old enough to be eligible for writeout by the kernel flusher threads, dynamically changed by ML to provide balanced powersave & performance UX
  • /proc/sys/vm/dirty_ratio;dirty_background_ratio - the dirty data RAM based ratio, optimized to provide better powersaving and performance


CPU governor tweaks:

  • sampling_rate - the frequency of lookup for CPU usage and decisions on what to do about the frequency, tuned for better performance
  • sampling_down_factor - how much time to "think" before scaling down CPU frequency, dynamically changed by ML to provide balanced powersave & performance UX
  • up_rate_us - the minimum amount of time to spend at a frequency before ramp up, tuned for better performance
  • down_rate_us - the minimum amount of time to spend at a frequency before ramp down, tuned for better powersaving
  • timer_slack - max additional time to defer handling the governor sampling timer, tuned for better performance
  • boost - don't go below hispeed_freq, dynamically changed by ML to provide balanced powersave & performance UX
  • use_migration_notif - take scheduler in account when calculating target frequency, enabled for better performance and powersaving
  • timer_rate - sample rate for reevaluating CPU load when the CPU is not idle, dynamically changed by ML to provide balanced powersave & performance UX
  • enable_prediction - desired frequency prediction basing on scheduler info, dynamically changed by ML to provide balanced powersave & performance UX
  • /sys/devices/system/cpu/cpu0/cpufreq/busfreq_static - static bus frequency tunable, disabled to be adaptive for better powersaving


Build.prop tweaks:

  • ro.HOME_APP_ADJ - enabled in order to force keep home launcher in memory under low RAM condition
  • persist.radio.ramdump;persist.sys.ssr.enable_ramdumps - disabled in order to turn OFF vendor RAM dumps
  • persist.wpa_supplicant.debug - disabled in order to reduce WLAN debugging overhead for better performance
  • dalvik.vm.checkjni - disabled to turn off unnecessary JNI checks & reduce it's overhead for better performance
  • dalvik.vm.check-dex-sum - disabled to turn off (just in case) unnecessary dex files sum checks & it's overhead for better performance
  • dalvik.vm.verify-bytecode - disabled to turn off bytecode checks & reduce it's overhead for better performance
  • libc.debug.malloc - disabled to turn off libc debugging & reduce it's overhead for better performance
  • debug.atrace.tags.enableflags;persist.traced.enable - disabled to turn off tracing & reduce it's overhead for better performance
  • vidc.debug.level - disabled to turn off video core debugging & reduce it's overhead for better performance
  • debug.mdpcomp.logs - disabled to turn off MDP composer logging & reduce it's overhead for better performance
  • ro.kernel.android.checkjni - disabled to turn off kernel side JNI checks & reduce it's overhead for better performance
  • touch.pressure.scale - tuned for better touch responsiveness
  • debug.hwui.render_dirty_regions - disabled to turn off unnecessary dirty regions rendering & reduce it's overhead for better performance
  • ro.lmk.log_stats - disabled to turn off LMK log stats & reduce it's overhead for better performance
  • debug.egl.hw - enabled for better EGL performance (for older devices)
  • persist.sys.strictmode.disable - enabled to disable OS strict mode (just in case it's enabled)
  • ro.ril.hsxpa;ro.ril.enable.dtm;ro.ril.hsdpa.category;ro.ril.hsupa.category (Niko network tweaks) - mobile data network related optional tweaks for higher throughput and lower latencies
  • debug.cpurend.vsync;hwui.disable_vsync;debug.sf.recomputecrop;debug.composition.type;persist.sys.composition.type;ro.hwui.texture_cache_size;ro.hwui.layer_cache_size;ro.hwui.path_cache_size;ro.hwui.r_buffer_cache_size;ro.hwui.drop_shadow_cache_size; (Niko GPU tweaks) - UI/GPU rendering related optional enhancing tweaks


Rest tweaks:

  • /sys/module/msm_performance/parameters/touchboost;/sys/power/pnpmgr/touch_boost - disabled to save more CPU cycles for power saving
  • /sys/module/cpu_boost/parameters/wakeup_boost;/sys/module/cpu_input_boost/parameters/wake_boost_duration - enabled & tuned for boosting CPU right after you wake your device for lagfree wakeup
  • /sys/module/cpu_boost/parameters/powerkey_input_boost_ms;/sys/module/cpu_boost/parameters/sched_boost_on_powerkey_input - enabled & tuned for boosting CPU when you press power button to boost wakeup process
  • /sys/module/cpu_boost/parameters/sched_boost_on_input - boosts CPU sched tasks on user input events, dynamically changed by ML to provide balanced powersave & performance UX
  • /sys/module/boost_control/parameters/app_launch_boost_ms - boosts CPU on launching app, tuned to provide better performance, still being powersave
  • /sys/kernel/fp_boost/enabled - boosts CPU on fingerprint event, enabled & tuned to boost wakeup process via FP touch
  • /sys/module/boost_control/...;/sys/module/cpu_boost/...; - rest kernel CPU boosters, tuned to provide better performance, still being powersave
  • /sys/module/cpu_boost/parameters/dynamic_stune_boost - EAS dynamic boost, automatically tuned to provide better performance, still being powersave
  • /sys/class/lcd/panel/power_reduce - supported by very rare displays, enabled for better powersaving
  • /sys/kernel/debug/msm_vidc/disable_thermal_mitigation - disables thermal mitigation of QCOM video core, enabled to disable any throttling effects
  • /sys/kernel/debug/msm_vidc/fw_debug_mode - disabled to deactivate QCOM video core firmware debugging & reduce it's overhead for better performance
  • /sys/devices/system/cpu/sched_mc_power_savings - when enabled, scheduler tries to schedule processes on as few cores as possible so that the others can go idle & save power. Dynamically changed to provide better power saving, not hurting performance
  • /sys/devices/virtual/sec/sec_touchscreen/tsp_threshold;/sys/class/touch/switch/set_touchscreen - touchscreen sensitivity optimization on supported Samsung devices
  • /sys/devices/platform/galcore/... - various configuration nodes for Vivante GPU, dynamically changed by ML to provide balanced powersave & performance UX
  • /sys/class/kgsl/kgsl-3d0/... - various configuration nodes for Adreno GPU, dynamically changed by ML to provide balanced powersave & performance UX
  • /sys/module/mali/...;/d/mali/...;/sys/class/misc/mali... - various configuration nodes for Mali GPU, dynamically changed by ML to provide balanced powersave & performance UX
  • /sys/module/adreno_idler/... - if supported by kernel, is deactivated to reduce UI lags
  • /sys/module/subsystem_restart/parameters/enable_ramdumps - disabled to deactivate RAM dumps & reduce it's overhead for better performance
  • /sys/module/lowmemorykiller/parameters/debug_level - disabled to deactivate LMK debugging & reduce it's overhead for better performance
  • log/debug - disabled a lot of various debugging/logging nodes in kernel modules to reduce overhead for better performance