summarylogtreecommitdiffstats
path: root/0024-ZEN-INTERACTIVE-Tune-CFS-for-interactivity.patch
diff options
context:
space:
mode:
Diffstat (limited to '0024-ZEN-INTERACTIVE-Tune-CFS-for-interactivity.patch')
-rw-r--r--0024-ZEN-INTERACTIVE-Tune-CFS-for-interactivity.patch138
1 files changed, 138 insertions, 0 deletions
diff --git a/0024-ZEN-INTERACTIVE-Tune-CFS-for-interactivity.patch b/0024-ZEN-INTERACTIVE-Tune-CFS-for-interactivity.patch
new file mode 100644
index 000000000000..15cd1187c850
--- /dev/null
+++ b/0024-ZEN-INTERACTIVE-Tune-CFS-for-interactivity.patch
@@ -0,0 +1,138 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
+Date: Mon, 27 Jan 2020 18:28:13 +0100
+Subject: [PATCH] ZEN: INTERACTIVE: Tune CFS for interactivity
+
+5.7:
+Take "sysctl_sched_nr_migrate" tune from early XanMod builds of 128. As
+of 5.7, XanMod uses 256 but that may affect applications that require
+timely response to IRQs.
+
+5.15:
+Per comment [1] on our ZEN INTERACTIVE commit, reducing the cost of
+migration causes the system less responsive under high load. Most
+likely the combination of reduced migration cost + the higher number of
+tasks that can be migrated at once contributes to this.
+
+To better handle this situation, restore the mainline migration cost
+value and also reduce the max number of tasks that can be migrated in
+batch from 128 to 64.
+
+If this doesn't help, we'll restore the reduced migration cost and keep
+total number of tasks that can be migrated at once to 32.
+
+[1] https://github.com/zen-kernel/zen-kernel/commit/be5ba234ca0a5aabe74bfc7e1f636f085bd3823c#commitcomment-63159674
+---
+ init/Kconfig | 8 ++++++++
+ kernel/sched/core.c | 4 +++-
+ kernel/sched/fair.c | 23 +++++++++++++++++++++++
+ 3 files changed, 34 insertions(+), 1 deletion(-)
+
+diff --git a/init/Kconfig b/init/Kconfig
+index 7420e7b3e53c..79ed6a865a5b 100644
+--- a/init/Kconfig
++++ b/init/Kconfig
+@@ -122,6 +122,14 @@ config ZEN_INTERACTIVE
+ Background-reclaim hugepages...: no -> yes
+ MG-LRU minimum cache TTL.......: 0 -> 1000 ms
+
++ --- CFS CPU Scheduler ----------------------------------
++
++ Scheduling latency.............: 6 -> 4 ms
++ Minimal granularity............: 0.75 -> 0.4 ms
++ Wakeup granularity.............: 1 -> 0.5 ms
++ Bandwidth slice size...........: 5 -> 3 ms
++ Task rebalancing threshold.....: 32 -> 64
++
+ config BROKEN
+ bool
+
+diff --git a/kernel/sched/core.c b/kernel/sched/core.c
+index 9745613d531c..613b5823bf60 100644
+--- a/kernel/sched/core.c
++++ b/kernel/sched/core.c
+@@ -74,7 +74,9 @@ __read_mostly int sysctl_resched_latency_warn_once = 1;
+ * Number of tasks to iterate in a single balance run.
+ * Limited because this is done with IRQs disabled.
+ */
+-#ifdef CONFIG_PREEMPT_RT
++#ifdef CONFIG_ZEN_INTERACTIVE
++const_debug unsigned int sysctl_sched_nr_migrate = 64;
++#elif defined(CONFIG_PREEMPT_RT)
+ const_debug unsigned int sysctl_sched_nr_migrate = 8;
+ #else
+ const_debug unsigned int sysctl_sched_nr_migrate = 32;
+diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
+index 5146163bfabb..27028558eeb2 100644
+--- a/kernel/sched/fair.c
++++ b/kernel/sched/fair.c
+@@ -35,8 +35,13 @@
+ *
+ * (default: 6ms * (1 + ilog(ncpus)), units: nanoseconds)
+ */
++#ifdef CONFIG_ZEN_INTERACTIVE
++unsigned int sysctl_sched_latency = 4000000ULL;
++static unsigned int normalized_sysctl_sched_latency = 4000000ULL;
++#else
+ unsigned int sysctl_sched_latency = 6000000ULL;
+ static unsigned int normalized_sysctl_sched_latency = 6000000ULL;
++#endif
+
+ /*
+ * The initial- and re-scaling of tunables is configurable
+@@ -56,8 +61,13 @@ unsigned int sysctl_sched_tunable_scaling = SCHED_TUNABLESCALING_LOG;
+ *
+ * (default: 0.75 msec * (1 + ilog(ncpus)), units: nanoseconds)
+ */
++#ifdef CONFIG_ZEN_INTERACTIVE
++unsigned int sysctl_sched_min_granularity = 400000ULL;
++static unsigned int normalized_sysctl_sched_min_granularity = 400000ULL;
++#else
+ unsigned int sysctl_sched_min_granularity = 750000ULL;
+ static unsigned int normalized_sysctl_sched_min_granularity = 750000ULL;
++#endif
+
+ /*
+ * Minimal preemption granularity for CPU-bound SCHED_IDLE tasks.
+@@ -70,7 +80,11 @@ unsigned int sysctl_sched_idle_min_granularity = 750000ULL;
+ /*
+ * This value is kept at sysctl_sched_latency/sysctl_sched_min_granularity
+ */
++#ifdef CONFIG_ZEN_INTERACTIVE
++static unsigned int sched_nr_latency = 10;
++#else
+ static unsigned int sched_nr_latency = 8;
++#endif
+
+ /*
+ * After fork, child runs first. If set to 0 (default) then
+@@ -87,8 +101,13 @@ unsigned int sysctl_sched_child_runs_first __read_mostly;
+ *
+ * (default: 1 msec * (1 + ilog(ncpus)), units: nanoseconds)
+ */
++#ifdef CONFIG_ZEN_INTERACTIVE
++unsigned int sysctl_sched_wakeup_granularity = 500000UL;
++static unsigned int normalized_sysctl_sched_wakeup_granularity = 500000UL;
++#else
+ unsigned int sysctl_sched_wakeup_granularity = 1000000UL;
+ static unsigned int normalized_sysctl_sched_wakeup_granularity = 1000000UL;
++#endif
+
+ const_debug unsigned int sysctl_sched_migration_cost = 500000UL;
+
+@@ -141,8 +160,12 @@ int __weak arch_asym_cpu_priority(int cpu)
+ *
+ * (default: 5 msec, units: microseconds)
+ */
++#ifdef CONFIG_ZEN_INTERACTIVE
++unsigned int sysctl_sched_cfs_bandwidth_slice = 3000UL;
++#else
+ unsigned int sysctl_sched_cfs_bandwidth_slice = 5000UL;
+ #endif
++#endif
+
+ static inline void update_load_add(struct load_weight *lw, unsigned long inc)
+ {
+--
+2.35.1
+