Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You Won't Believe These Performance & Battery Hacks #2

Open
wants to merge 24 commits into
base: staging
Choose a base branch
from

Conversation

taalojarvi
Copy link

@taalojarvi taalojarvi commented Jul 20, 2024

Hi @David112x,

RFC on this pull request that implements the following changes:

  • Disables CPU Input Boost and Devfreq boost: These features consume significant power for minimal performance gains. Recommend switching to SCHED_WALT for better UX instead.
  • Reverts force fast charging: Force fast charging is not recommended and can potentially be dangerous. This change reverts the commits related to it.
  • Sets timer frequency to 300 Hz: Aligns with Google's recommendations for jitter reduction.
  • Upstream zSTD to1.5.5
  • Tunes scheduler for responsiveness
  • Disable OnePlus MM hacks for better multitasking
  • Conditionally use Full LTO

These changes aim to improve overall device performance and battery life without sacrificing essential features.

Additional Notes:

Kyle Lin and others added 24 commits June 1, 2024 13:36
Bug: 142550028
Test: Build and boot to home
Change-Id: Iff24f21052422bbc3fe932a0fd1f8137376c9300
Signed-off-by: Kyle Lin <[email protected]>
Usually set by init

This reverts commit 4ed9e7e.
This is unnecessary. Easier to fix by disabling reverse charging or reverting that spurious logspam silence commit

This reverts commit ab64ec4.
Unnecessary, let EAS do its job in peace.
Instead of killing an entire feature for the sake of making audio work while charing, let's revert a spurious change.

Marvin suggested that this issue may due to a race condition. Unfortunately, i'm not experienced enough to triage this.

You can also alternatively fix this by unsetting 'CONFIG_REVERSE_CHARGE', although i'm not aware of the consequences of the same.

Ref: Stratosphere-Kernel/android_kernel_xiaomi_surya@770deaa
Signed-off-by: taalojarvi <[email protected]>
Switching from full-LTO to ThinLTO has performance impact on
PtsFirstPartyBenchmarksTestCases:
 - com.google.android.benchmark.pts.BinderPerfBenchmark
 - com.google.android.benchmark.pts.GoogleBenchmarkTest

This patch disable ThinLTO in sunfish_defconfig

Bug: 148617312
Bug: 157708274
Change-Id: I94e6cabac2c7eb0bfe7365ee9ab6b87298eb7920
Signed-off-by: Wilson Sung <[email protected]>
Signed-off-by: Pranav Vashi <[email protected]>
Signed-off-by: taalojarvi <[email protected]>
* we don't even ship these.

Change-Id: I70feecb385cddfa0ffafeebdc17dbe6ad927d286
Signed-off-by: Rasenkai <[email protected]>
Signed-off-by: Pranav Vashi <[email protected]>
This removes sdcardfs, instead using a combination
of FUSE, casefolding at the FS layer, and project
quotas

Change-Id: If181d623a11919b6a0d1a1198fc7888cff82c6cc
Bug: 138320467
Test: Boot with emulated_storage.mk included
Signed-off-by: Daniel Rosenberg <[email protected]>
Signed-off-by: taalojarvi <[email protected]>
Removed CONFIG_HID_PLAYSTATION support to pass
SonyDualSenseEdge cts testcases.

Change-Id: I25e2ea8a9e7e5a1ca53ff7e738e9611ca427294c
Signed-off-by: Saranya R <[email protected]>
(cherry picked from commit 5ce35d31b461bf1571b135b9e4056a22e0b9752b)
Signed-off-by: taalojarvi <[email protected]>
This reverts commit c045bc8.

Signed-off-by: taalojarvi <[email protected]>
- Inspired by [1].
- Ported over to zstd v1.5.2.

[1]: nem0-z/android_kernel_oneplus_sm8150@ad113ac

Co-authored-by: Cyber Knight <[email protected]>
Signed-off-by: DevriesL <[email protected]>
Signed-off-by: Artem Labazov <[email protected]>
Signed-off-by: Adam W. Willis <[email protected]>
Signed-off-by: Cyber Knight <[email protected]>
- Syncs latest upstream ZSTD from [1].

- This update retains the following commits:
cyberknight777/dragonheart_kernel_oneplus_sm8150@edc41e9 {"lib: zstd: Fix attribute declaration"}
cyberknight777/dragonheart_kernel_oneplus_sm8150@31ef7d2 {"lib: zstd: include a missing header"}
cyberknight777/dragonheart_kernel_oneplus_sm8150@4927d31 {"lib: zstd: define UINTPTR_MAX"}

[1]: https://github.com/facebook/zstd/commits/v1.5.4

Signed-off-by: Cyber Knight <[email protected]>
Signed-off-by: Cyber Knight <[email protected]>
Only able to be passed on full LTO, not thin LTO. Additionally, this was
improperly added, KBUILD_CFLAG does not exist, only KBUILD_CFLAGS.

Signed-off-by: Cyber Knight <[email protected]>
Signed-off-by: taalojarvi <[email protected]>
Since Android 12, memory management on Androids has been affected
significantly, especially on devices with <=4GB RAMs.

Multitasking on default settings was a horror and introducing custom Low
Memory Killers like SLMK did no much improvements.

Introduction of MGLRU seems to have relaxed this situation and now apps
don't get killed randomly. Instead, they get swapped to zRAM aggressively.

In such situation, reducing swappiness parameter seems to have helped alot
in multitasking and it seems fluid now.

Test: on normal usage, keep 5-6 apps and use them in repeat.
Outcome: none of them gets killed or swapped on in a short epoch, while 60%
still stays in memory after 7 hours idling.

Signed-off-by: Panchajanya1999 <[email protected]>
Signed-off-by: taalojarvi <[email protected]>
Signed-off-by: HolyAngel <[email protected]>
Signed-off-by: Salllz <[email protected]>
Signed-off-by: alanndz <[email protected]>
Signed-off-by: Cyber Knight <[email protected]>
(cherry picked from commit 75bf13c9f82eb88f5d578b6bb3022092768d985a)
Signed-off-by: Panchajanya1999 <[email protected]>
Signed-off-by: HolyAngel <[email protected]>
Signed-off-by: Salllz <[email protected]>
Signed-off-by: alanndz <[email protected]>
Signed-off-by: Cyber Knight <[email protected]>
(cherry picked from commit b857014598f975fd24ab06cca465ec47a7b0f3c9)
Signed-off-by: Panchajanya1999 <[email protected]>
David's local builds would be impacted by this change. Switch to using a conditonal patch for Full LTO builds.

This reverts commit 7402193.

Signed-off-by: taalojarvi <[email protected]>
Checks if the build is running on GitHub Actions. If true, switches the build to Full LTO

Refs:
[1]: https://docs.github.com/en/actions/learn-github-actions/variables
[2]: 7402193

Signed-off-by: taalojarvi <[email protected]>
@taalojarvi taalojarvi changed the title Improve Performance & Battery Life: Disable Boost, Fix Audio, & Set Timer Freq You Won't Believe These Performance & Battery Hacks Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants