* This debug logging consumes 10% of all the CPU
cycles in the drivers communicating with the DSP.
* Disable the logging for the time being until we add
a config.
Bug: 71867957
Change-Id: I97d418fee3d4576b077ed284ed5ae4447da5a789
* Excessive logging -- not present on angler -- is
affecting performance, contributing to missed audio
deadlines and likely other latency-dependent tasks.
Bug: 30375418
[@0ctobot: Extend patch to cover binder_alloc_debug_mask]
Co-authored-by: Adam W. Willis <return.of.octobot@gmail.com>
Change-Id: I36c4ce8a0294e5e7847a3fd884691cb178cd95c2
Commit "rcu: Create RCU-specific workqueues with rescuers" switched RCU
to using local workqueses and removed power efficiency flag from them.
This caused a performance regression that can be observed in Geekbench 5
after enabling CONFIG_WQ_POWER_EFFICIENT_DEFAULT: score went down from
760/2500 to 620/2300 (single/multi core respectively).
Add WQ_POWER_EFFICIENT flag to avoid this regression.
Change-Id: I2c4f41faa55548f9e81a1c0cbe10703948062d89
Remote register I/O amounts to a measurably significant portion of CPU
time due to how frequently this function is used. Cache the value of
each register on-demand and use this value in future invocations to
mitigate the expensive I/O.
Co-authored-by: Sultan Alsawaf <sultan@kerneltoast.com>
[@0ctobot: Adapted for msm-4.19]
Change-Id: I6846ee58c476a125076d0c3ad351f9e15eba180a
* These have all moved into the ramdisk, and boot devices
has gone to the kernel commandline.
Bug: 117933812
Change-Id: I0d06607c522c08f50484b9eff4dc78b21cc083f5
* Android devices use LMK algorythms, so there's no
reason to disable and enable the OOM killer when entering and exiting
suspend.
* This is a fixed version of https://github.com/YaroST12/VIOLENT_kernel/commit/86e59a93b2ef
Co-authored-by: Danny Lin <danny@kdrag0n.dev>
Change-Id: Icb2a57e51128a9ae8d578e697f041ff19871351b
* Similar to what I've done on other devices, revert
to normal grace periods to reduce power usage.
* Expedited RCU hammers CPUs with IPIs to reduce grace
period durations and thus RCU latency, but that disrupts
busy CPUs and causes unnecessary wakeups while providing
little to no improvement in real-world performance.
Change-Id: I2b55e4aaa82bb670dfd6fb417b05fe9ae685e0a8
* Our kernel only runs on known systems where broken
IRQs would already have been discovered, so disable
this to reduce overhead in the IRQ handling path.
Change-Id: Ia9e655dc9891f9cb94a6123ceaec43ba7c5fd5b1
Few wakelocks tends to get stuck for no reason. Blocking them
isn't necessary and sometimes blocking them breaks basic
functionality.
Wakelocks like "tx_swr_ctrl" tends to get stuck if we keep earphones
connected and drops battery massively.
Test: Keep earphones plugged in and leave device for few hours
Expected result: No "tx_swr_ctrl" is being stuck.
Actual result: Patch is working as expected.
Change-Id: I5296990a84ab44cf6e449d6535b8b99408c415c8
Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>
We need kgsl_worker_thread to preempt
all userspace surfaceflinger threads to
avoid a possible deadlock.
This will prevent the SF
threads from "stealing" cputime from
kgsl_worker_thread.
This is important, since kgsl_worker_thread
executes work which blocks SF from proceeding.
Signed-off-by: Alex Naidis <alex.naidis@linux.com>
It does not make sense to run kgsl on high and devfreq on regular
priority.
Change-Id: Ie5e6c9353a4e1324a6a49278e5ad3638462f551c
Signed-off-by: flar2 <asegaert@gmail.com>
These wakelocks has pretty high wakeups [ rmnet_ipa had 496 wakeups in just 20 minutes, IPA_CLIENT_ had 329 wakeups in ~1hr]. Block them to ensure they aren't causing "unnecessary"(might vary) wakeups.
Signed-off-by: Panchajanya1999 <panchajanya@azure-dev.live>
Signed-off-by: Sudeep Duhoon <rishi.gothic@gmail.com>
Signed-off-by: Adithya R <gh0strider.2k18.reborn@gmail.com>
There are now two lists:
- the previously existing list of user defined wakelocks to block
- a new list called "wakelock_blocker_default" which comes prepopulated with the most common
and safe wakelocks to block:
qcom_rx_wakelock;wlan;wlan_wow_wl;wlan_extscan_wl;netmgr_wl;NETLINK
A combination of both wakelock lists will be blocked finally.
Based on ideas of FranciscoFranco's non-generic driver.
Sysfs node:
/sys/class/misc/boeffla_wakelock_blocker/wakelock_blocker
- list of wakelocks to be blocked, separated by semicolons
/sys/class/misc/boeffla_wakelock_blocker/debug
- write: 0/1 to switch off and on debug logging into dmesg
- read: get current driver internals
/sys/class/misc/boeffla_wakelock_blocker/version
- show driver version
Signed-off-by: andip71 <andreasp@gmx.de>
Generating a sync fence name by allocating memory dynamically and using
scnprintf in a hot path results in excessive CPU time wasted on unneeded
debug info. Remove the name generation entirely to cut down CPU waste in
the GPU's rendering hot path.
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
POPP constantly attempts to lower the GPU's frequency behind the
governor's back in order to save power; however, the GPU governor in use
(msm-adreno-tz) is very good at determining the GPU's load and selecting
an appropriate frequency to run the GPU at.
POPP was created long ago, perhaps when msm-adreno-tz didn't exist or
didn't work so well, so it is clearly deprecated. Remove it.
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Waking the GPU upon touch wastes power when the screen is being touched
in a way that does not induce animation or any actual need for GPU usage.
Instead of preemptively waking the GPU on touch input, wake it up upon
receiving a IOCTL_KGSL_GPU_COMMAND ioctl since it is a sign that the GPU
will soon be needed.
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
-O3 is much more stable with modern compilers these days than it was a
decade ago. Using -O3 on the kernel results in significantly improved
hackbench performance, which is a sign that overall performance in the
kernel is improved. It works especially well in conjunction with LTO.
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
ARM erratum 1188873 can cause very severe issues if left unmitigated on
affected cores. However, if unrelated ARM arch timer mitigations are
disabled (e.g. Freescale, Hisilicon, and Cortex-A73 errata), the
mitigation for 1188873 will no longer be applied even if the config
option is on. This is because this mitigation is implemented as a
generic OOL erratum workaround, and disabling other mitigations will
cause the OOL workaround framework to stop being compiled.
Add an explicit dependency on the workaround framework to fix this, and
also add a dependency on ARM_ARCH_TIMER while we're at it.
On Android, leaving this erratum causes the AlarmManager thread in
system_server to use 100% CPU in the background after 20 minutes of
screen-off idle. The CPU hogging never stops until sytem_server is
killed and sometimes also causes system_server crashes due to invalid
negative durations in batterystats resulting from the corrupted timer
values.
Test: Let device idle for 20 minutes and check AlarmManager CPU usage
Signed-off-by: Danny Lin <danny@kdrag0n.dev>
The fix for ARM erratum 1188873 is the only configurable one in use.
Disable the rest.
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Gagan Malvi <malvigagan@gmail.com>
A lot of CPU time is wasted on allocating, populating, and copying
debug names back and forth with userspace when they're not actually
needed. We can't just remove the name buffers from the various sync data
structures though because we must preserve ABI compatibility with
userspace, but instead we can just pretend the name fields of the
user-shared structs aren't there. This massively reduces the sizes of
memory allocated for these data structures and the amount of data passed
between userspace, as well as eliminates a kzalloc() entirely from
sync_file_ioctl_fence_info(), thus improving graphics performance.
Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com>
A measurably significant amount of CPU time is spent on logging events
for debugging purposes in lpm_cpuidle_enter. Kill the useless logging to
reduce overhead.
Signed-off-by: Danny Lin <danny@kdrag0n.dev>