2024-12-10 00:17:37 +03:00
|
|
|
From f654ea11471f81ac7dd68467f552db25722df25e Mon Sep 17 00:00:00 2001
|
2024-10-29 05:12:06 +03:00
|
|
|
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
|
|
|
|
Date: Mon, 27 Jan 2020 18:27:16 +0100
|
|
|
|
Subject: ZEN: INTERACTIVE: Tune ondemand governor for interactivity
|
|
|
|
|
|
|
|
4.10:
|
|
|
|
During some personal testing with the Dolphin emulator, MuQSS has
|
|
|
|
serious problems scaling its frequencies causing poor performance where
|
|
|
|
boosting the CPU frequencies would have fixed them. Reducing the
|
|
|
|
up_threshold to 45 with MuQSS appears to fix the issue, letting the
|
|
|
|
introduction to "Star Wars: Rogue Leader" run at 100% speed versus about
|
|
|
|
80% on my test system.
|
|
|
|
|
|
|
|
Also, lets refactor the definitions and include some indentation to help
|
|
|
|
the reader discern what the scope of all the macros are.
|
|
|
|
|
|
|
|
5.4:
|
|
|
|
On the last custom kernel benchmark from Phoronix with Xanmod, Michael
|
|
|
|
configured all the kernels to run using ondemand instead of the kernel's
|
|
|
|
[default selection][1]. This reminded me that another option outside of
|
|
|
|
the kernels control is the user's choice to change the cpufreq governor,
|
|
|
|
for better or for worse.
|
|
|
|
|
|
|
|
In Liquorix, performance is the default governor whether you're running
|
|
|
|
acpi-cpufreq or intel-pstate. I expect laptop users to install TLP or
|
|
|
|
LMT to control the power balance on their system, especially when
|
|
|
|
they're plugged in or on battery. However, it's pretty clear to me a
|
|
|
|
lot of people would choose ondemand over performance since it's not
|
|
|
|
obvious it has huge performance ramifications with MuQSS, and ondemand
|
|
|
|
otherwise is "good enough" for most people.
|
|
|
|
|
|
|
|
Lets codify lower up thresholds for MuQSS to more closely synergize with
|
|
|
|
its aggressive thread migration behavior. This way when ondemand is
|
|
|
|
configured, you get sort of a "performance-lite" type of result but with
|
|
|
|
the power savings you expect when leaving the running system idle.
|
|
|
|
|
|
|
|
[1]: https://www.phoronix.com/scan.php?page=article&item=xanmod-2020-kernel
|
|
|
|
|
|
|
|
5.14:
|
|
|
|
Although CFS and similar schedulers (BMQ, PDS, and CacULE), reuse a lot
|
|
|
|
more of mainline scheduling and do a good job of pinning single threaded
|
|
|
|
tasks to their respective core, there's still applications that
|
|
|
|
confusingly run steady near 50% and benefit from going full speed or
|
|
|
|
turbo when they need to run (emulators for more recent consoles come to
|
|
|
|
mind).
|
|
|
|
|
|
|
|
Drop the up threshold for all non-MuQSS schedulers from 80/95 to 55/60.
|
|
|
|
|
|
|
|
5.15:
|
|
|
|
Remove MuQSS cpufreq configuration.
|
|
|
|
---
|
|
|
|
drivers/cpufreq/cpufreq_ondemand.c | 8 +++++++-
|
|
|
|
init/Kconfig | 6 ++++++
|
|
|
|
2 files changed, 13 insertions(+), 1 deletion(-)
|
|
|
|
|
|
|
|
--- a/drivers/cpufreq/cpufreq_ondemand.c
|
|
|
|
+++ b/drivers/cpufreq/cpufreq_ondemand.c
|
|
|
|
@@ -18,10 +18,16 @@
|
|
|
|
#include "cpufreq_ondemand.h"
|
|
|
|
|
|
|
|
/* On-demand governor macros */
|
|
|
|
+#if defined(CONFIG_ZEN_INTERACTIVE)
|
|
|
|
+#define DEF_FREQUENCY_UP_THRESHOLD (55)
|
|
|
|
+#define MICRO_FREQUENCY_UP_THRESHOLD (60)
|
|
|
|
+#define DEF_SAMPLING_DOWN_FACTOR (5)
|
|
|
|
+#else
|
|
|
|
#define DEF_FREQUENCY_UP_THRESHOLD (63)
|
|
|
|
+#define MICRO_FREQUENCY_UP_THRESHOLD (70)
|
|
|
|
#define DEF_SAMPLING_DOWN_FACTOR (100)
|
|
|
|
+#endif
|
|
|
|
#define MAX_SAMPLING_DOWN_FACTOR (100000)
|
|
|
|
-#define MICRO_FREQUENCY_UP_THRESHOLD (70)
|
|
|
|
#define MIN_FREQUENCY_UP_THRESHOLD (1)
|
|
|
|
#define MAX_FREQUENCY_UP_THRESHOLD (100)
|
|
|
|
|
|
|
|
--- a/init/Kconfig
|
|
|
|
+++ b/init/Kconfig
|
2024-12-10 00:17:37 +03:00
|
|
|
@@ -176,6 +176,12 @@ config ZEN_INTERACTIVE
|
2024-10-29 05:12:06 +03:00
|
|
|
Bandwidth slice size...........: 5 -> 3 ms
|
|
|
|
Task rebalancing threshold.....: 32 -> 8
|
|
|
|
|
|
|
|
+ --- CPUFreq Settings -----------------------------------
|
|
|
|
+
|
2024-12-10 00:17:37 +03:00
|
|
|
+ Ondemand sampling down factor..: 1 -> 5
|
|
|
|
+ Ondemand default up threshold..: 80 -> 55
|
|
|
|
+ Ondemand micro up threshold....: 95 -> 60
|
2024-10-29 05:12:06 +03:00
|
|
|
+
|
|
|
|
config BROKEN
|
|
|
|
bool
|
|
|
|
|