Page MenuHomeSolus

Modify default config to combat performance issues
ClosedPublic

Authored by stalebrim on Dec 28 2020, 4:22 PM.

Details

Summary
  • Use schedutil as scaling governor on battery
  • Use performance as scaling governor on AC
  • Speed up shutdown and suspend by not applying AC settings on shutdown/suspend
Test Plan
  • Check config has changed on laptop that previously had TLP
  • Check current scaling governor on battery (which is schedutil)

Diff Detail

Repository
R3046 tlp
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

stalebrim created this revision.Dec 28 2020, 4:22 PM
stalebrim requested review of this revision.Dec 28 2020, 4:22 PM
JoshStrobl requested changes to this revision.Dec 30 2020, 6:23 PM
JoshStrobl added a subscriber: JoshStrobl.

I'd like to see some up-to-date performance metrics on schedutil vs powersave to see if the gains in performance of schedutil (if any in reality) meaningfully negate the loss (if any) in battery life from the presumably higher clocks and changes to P-state.

This revision now requires changes to proceed.Dec 30 2020, 6:23 PM
stalebrim added a comment.EditedDec 30 2020, 6:28 PM

I'd like to see some up-to-date performance metrics on schedutil vs powersave to see if the gains in performance of schedutil (if any in reality) meaningfully negate the loss (if any) in battery life from the presumably higher clocks and changes to P-state.

Another solution I was thinking was to comment out the scheduler parts altogether so it would use to kernel defaults. They were uncommented on latest diff and after that people with TLP started to complain about performance issues.

Another solution I was thinking was to comment out the scheduler parts altogether so it would use to kernel defaults. They were uncommented on latest diff and after that people with TLP started to complain about performance issues.

This seems more like an issue with the fact that CPU_SCALING_GOVERNOR_ON_AC was erroneously set to powersave rather than performance or ondemand. It wouldn't explain the issues people were getting on desktops with TLP disabled, but with TLP enabled I could certainly see why (namely on laptops, there's zero reason to have TLP on a desktop).

I'm still curious about seeing any sort of in-depth and up-to-date analysis on powersave vs schedutil though.

serebit added a subscriber: serebit.Jan 2 2021, 5:47 PM

I have some benchmarks! Give me a moment.

I appreciate the benchmarks but I was kinda expecting the testing and metrics to be done on a laptop, running on battery, so we can get an idea on how significant the reduction is in battery life for the additional performance.

I appreciate the benchmarks but I was kinda expecting the testing and metrics to be done on a laptop, running on battery, so we can get an idea on how significant the reduction is in battery life for the additional performance.

Ah, yeah, I can do that too-- I just happened to have those results on hand. Any particular tests you'd like me to run?

I appreciate the benchmarks but I was kinda expecting the testing and metrics to be done on a laptop, running on battery, so we can get an idea on how significant the reduction is in battery life for the additional performance.

Ah, yeah, I can do that too-- I just happened to have those results on hand. Any particular tests you'd like me to run?

Nothing to crazy, probably just:

  1. Battery life at idle until it is RIP
  2. Battery life watching a video in Firefox. Here's an example: https://www.youtube.com/watch?v=AgpWX18dby4

To shorten the battery life artificially and reduce overall test time, you could set brightness to 100%, disable dimming and locking, turn on bluetooth and wifi (even if you aren't connected to a wifi network but only on ethernet).

If you can think of any real-world example testing that doesn't take an eternity that you'd want to do instead, you're welcome to do that. It just needs to be effectively the same run-to-run to reduce any test result variance. We already have a good idea as to the performance gains when we're really hammering the CPU, but I doubt people are going to be compiling the kernel back-to-back-to-back on a laptop on battery of all things.

stalebrim added a comment.EditedJan 3 2021, 5:17 PM

I hooked up my Thinkpad T 430 using Solus Plasma to a wattage meter (AC, no battery, no TLP). Then I did three tests, taking readings every 10 seconds of the power consumption.

  1. 1080p video on Firefox, 2 minutes, 12 readings per governor (https://www.youtube.com/watch?v=AgpWX18dby4)
governorpowersaveschedutilondemand performance
average (watts)20,2821,8623,1523,81
  1. Idle, 1 minute, 6 readings per governor
governorpowersaveschedutilondemandperformance
average (watts)10,5210,6310,6010,65
  1. 720p video on Firefox, 1 minute, 6 readings per governor (https://www.youtube.com/watch?v=B4f7qAdddvg)
governorpowersaveschedutilondemandperformance
average (watts)18,6719,3821,7021,48
  1. Total average
governorpowersaveschedutilondemandperformance
average (watts)12,3612,9713,8613,99

It's not much, but hope it gives a direction.

This comment was removed by serebit.
serebit added a comment.EditedJan 8 2021, 8:01 PM

Ran a benchmark with all available governors on my laptop on battery: https://openbenchmarking.org/result/2101089-HA-FIREFOXVI77&scalar=1

This test was run with a VP9 video streaming and playing on Firefox (using the software decoder). schedutil has a slightly higher average power draw than powersave (500 mW difference). Anecdotally, the system is MUCH more responsive with schedutil enabled. More general-use-case benchmarks to follow.

More benchmarks! https://openbenchmarking.org/result/2101098-HA-GOVERNORT78. For some reason, sensor output wasn't logged for powersave in the GIMP benchmarks.

Some interesting results here:

  • Context switching, program launching, thread creation, and process creation are all identical between schedutil and performance. powersave lags behind *massively* in all four.
  • In heavy loads like GZip compression/decompression and OpenSSL, schedutil and performance are roughly equivalent in both power draw and speed.
  • In the GIMP test, schedutil is slightly behind performance in speed, but massively improves in power draw.
  • In the LibreOffice export test, schedutil is closer to powersave in speed, and between powersave and performance in power draw.

Now time for qualitative assessment!

If you ask me, switching to schedutil FOR THIS SCENARIO is worth the increased power draw. Schedutil is rather good at managing clocks depending on load. As shown with the Firefox video benches with CPU decoding, the power draw increases by a negligible amount when not much load is applied to the system. In addition, when there is a 100% load for a period of time, that period of time is shortened by the additional power fed to the cores by an amount proportional to the increase in power draw.

Also, context switching is over twice as slow on powersave, which is NOTICEABLY sluggish.

JoshStrobl accepted this revision.Jan 10 2021, 12:04 AM

Changes approved based on the benchmark results provided in the last couple comments 👍

This revision is now accepted and ready to land.Jan 10 2021, 12:04 AM
This revision was automatically updated to reflect the committed changes.

those results are actually redonkulous!