summarylogtreecommitdiffstats
path: root/0025-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch
diff options
context:
space:
mode:
Diffstat (limited to '0025-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch')
-rw-r--r--0025-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch97
1 files changed, 97 insertions, 0 deletions
diff --git a/0025-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch b/0025-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch
new file mode 100644
index 000000000000..62cb915ad4d5
--- /dev/null
+++ b/0025-ZEN-INTERACTIVE-Tune-ondemand-governor-for-interacti.patch
@@ -0,0 +1,97 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
+Date: Mon, 27 Jan 2020 18:27:16 +0100
+Subject: [PATCH] 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(-)
+
+diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
+index 6a41ea4729b8..b47804173462 100644
+--- 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 (80)
++#define MICRO_FREQUENCY_UP_THRESHOLD (95)
+ #define DEF_SAMPLING_DOWN_FACTOR (1)
++#endif
+ #define MAX_SAMPLING_DOWN_FACTOR (100000)
+-#define MICRO_FREQUENCY_UP_THRESHOLD (95)
+ #define MICRO_FREQUENCY_MIN_SAMPLE_RATE (10000)
+ #define MIN_FREQUENCY_UP_THRESHOLD (1)
+ #define MAX_FREQUENCY_UP_THRESHOLD (100)
+diff --git a/init/Kconfig b/init/Kconfig
+index 79ed6a865a5b..3c2026636085 100644
+--- a/init/Kconfig
++++ b/init/Kconfig
+@@ -130,6 +130,12 @@ config ZEN_INTERACTIVE
+ Bandwidth slice size...........: 5 -> 3 ms
+ Task rebalancing threshold.....: 32 -> 64
+
++ --- CPUFreq Settings -----------------------------------
++
++ Ondemand sampling down factor..: 1 -> 5
++ Ondemand default up threshold..: 80 -> 55
++ Ondemand micro up threshold....: 95 -> 60
++
+ config BROKEN
+ bool
+
+--
+2.35.1
+