6.8 RC
This commit is contained in:
parent
08d40ea432
commit
71c1b13c3b
@ -1,23 +1,24 @@
|
||||
From b6a7058a13f345d5aa5426466f9104da43d47ce4 Mon Sep 17 00:00:00 2001
|
||||
From 97dcd5da7813021da6111c09488a1ebe75f1d935 Mon Sep 17 00:00:00 2001
|
||||
From: Piotr Gorski <lucjan.lucjanov@gmail.com>
|
||||
Date: Tue, 5 Dec 2023 15:49:10 +0100
|
||||
Date: Mon, 26 Feb 2024 09:09:36 +0100
|
||||
Subject: [PATCH] bore-cachy
|
||||
|
||||
Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
|
||||
---
|
||||
include/linux/sched.h | 10 ++
|
||||
init/Kconfig | 19 ++++
|
||||
kernel/sched/core.c | 128 ++++++++++++++++++++++++
|
||||
kernel/sched/debug.c | 3 +
|
||||
kernel/sched/fair.c | 216 +++++++++++++++++++++++++++++++++++++---
|
||||
include/linux/sched.h | 11 ++
|
||||
init/Kconfig | 19 +++
|
||||
kernel/sched/core.c | 146 +++++++++++++++++++++
|
||||
kernel/sched/debug.c | 57 +++++++-
|
||||
kernel/sched/fair.c | 281 ++++++++++++++++++++++++++++++++++++----
|
||||
kernel/sched/features.h | 4 +
|
||||
6 files changed, 366 insertions(+), 14 deletions(-)
|
||||
kernel/sched/sched.h | 7 +
|
||||
7 files changed, 501 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/include/linux/sched.h b/include/linux/sched.h
|
||||
index 77f01ac38..01f2839ad 100644
|
||||
index ffe8f618a..314c2c981 100644
|
||||
--- a/include/linux/sched.h
|
||||
+++ b/include/linux/sched.h
|
||||
@@ -559,6 +559,16 @@ struct sched_entity {
|
||||
@@ -547,6 +547,17 @@ struct sched_entity {
|
||||
u64 sum_exec_runtime;
|
||||
u64 prev_sum_exec_runtime;
|
||||
u64 vruntime;
|
||||
@ -26,19 +27,20 @@ index 77f01ac38..01f2839ad 100644
|
||||
+ u8 prev_burst_penalty;
|
||||
+ u8 curr_burst_penalty;
|
||||
+ u8 burst_penalty;
|
||||
+ u8 slice_score;
|
||||
+ u8 burst_score;
|
||||
+ u32 burst_load;
|
||||
+ u8 child_burst;
|
||||
+ u16 child_burst_cnt;
|
||||
+ u32 child_burst_cnt;
|
||||
+ u64 child_burst_last_cached;
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
s64 vlag;
|
||||
u64 slice;
|
||||
|
||||
diff --git a/init/Kconfig b/init/Kconfig
|
||||
index 9dee4c100..49d343e97 100644
|
||||
index 47671886d..c99132cf6 100644
|
||||
--- a/init/Kconfig
|
||||
+++ b/init/Kconfig
|
||||
@@ -1278,6 +1278,25 @@ config CHECKPOINT_RESTORE
|
||||
@@ -1299,6 +1299,25 @@ config CHECKPOINT_RESTORE
|
||||
|
||||
If unsure, say N here.
|
||||
|
||||
@ -65,10 +67,10 @@ index 9dee4c100..49d343e97 100644
|
||||
bool "Automatic process group scheduling"
|
||||
select CGROUPS
|
||||
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
|
||||
index a854b7183..a98cfa7ab 100644
|
||||
index 9116bcc90..64b663a7b 100644
|
||||
--- a/kernel/sched/core.c
|
||||
+++ b/kernel/sched/core.c
|
||||
@@ -4488,6 +4488,123 @@ int wake_up_state(struct task_struct *p, unsigned int state)
|
||||
@@ -4507,6 +4507,141 @@ int wake_up_state(struct task_struct *p, unsigned int state)
|
||||
return try_to_wake_up(p, state, 0);
|
||||
}
|
||||
|
||||
@ -77,20 +79,22 @@ index a854b7183..a98cfa7ab 100644
|
||||
+extern u8 sched_burst_fork_atavistic;
|
||||
+extern uint sched_burst_cache_lifetime;
|
||||
+
|
||||
+void __init sched_init_bore(void) {
|
||||
+static void __init sched_init_bore(void) {
|
||||
+ init_task.se.burst_time = 0;
|
||||
+ init_task.se.prev_burst_penalty = 0;
|
||||
+ init_task.se.curr_burst_penalty = 0;
|
||||
+ init_task.se.burst_penalty = 0;
|
||||
+ init_task.se.slice_score = 0;
|
||||
+ init_task.se.burst_score = 0;
|
||||
+ init_task.se.child_burst_last_cached = 0;
|
||||
+ init_task.se.burst_load = 0;
|
||||
+}
|
||||
+
|
||||
+void inline sched_fork_bore(struct task_struct *p) {
|
||||
+ p->se.burst_time = 0;
|
||||
+ p->se.curr_burst_penalty = 0;
|
||||
+ p->se.slice_score = 0;
|
||||
+ p->se.burst_score = 0;
|
||||
+ p->se.child_burst_last_cached = 0;
|
||||
+ p->se.burst_load = 0;
|
||||
+}
|
||||
+
|
||||
+static u32 count_child_tasks(struct task_struct *p) {
|
||||
@ -100,8 +104,14 @@ index a854b7183..a98cfa7ab 100644
|
||||
+ return cnt;
|
||||
+}
|
||||
+
|
||||
+static inline bool task_is_inheritable(struct task_struct *p) {
|
||||
+ return (p->sched_class == &fair_sched_class);
|
||||
+}
|
||||
+
|
||||
+static inline bool child_burst_cache_expired(struct task_struct *p, u64 now) {
|
||||
+ return (p->se.child_burst_last_cached + sched_burst_cache_lifetime < now);
|
||||
+ u64 expiration_time =
|
||||
+ p->se.child_burst_last_cached + sched_burst_cache_lifetime;
|
||||
+ return ((s64)(expiration_time - now) < 0);
|
||||
+}
|
||||
+
|
||||
+static void __update_child_burst_cache(
|
||||
@ -113,13 +123,13 @@ index a854b7183..a98cfa7ab 100644
|
||||
+ p->se.child_burst_last_cached = now;
|
||||
+}
|
||||
+
|
||||
+static void update_child_burst_cache(struct task_struct *p, u64 now) {
|
||||
+static inline void update_child_burst_direct(struct task_struct *p, u64 now) {
|
||||
+ struct task_struct *child;
|
||||
+ u32 cnt = 0;
|
||||
+ u32 sum = 0;
|
||||
+
|
||||
+ list_for_each_entry(child, &p->children, sibling) {
|
||||
+ if (child->sched_class != &fair_sched_class) continue;
|
||||
+ if (!task_is_inheritable(child)) continue;
|
||||
+ cnt++;
|
||||
+ sum += child->se.burst_penalty;
|
||||
+ }
|
||||
@ -127,7 +137,15 @@ index a854b7183..a98cfa7ab 100644
|
||||
+ __update_child_burst_cache(p, cnt, sum, now);
|
||||
+}
|
||||
+
|
||||
+static void update_child_burst_cache_atavistic(
|
||||
+static inline u8 __inherit_burst_direct(struct task_struct *p, u64 now) {
|
||||
+ struct task_struct *parent = p->real_parent;
|
||||
+ if (child_burst_cache_expired(parent, now))
|
||||
+ update_child_burst_direct(parent, now);
|
||||
+
|
||||
+ return parent->se.child_burst;
|
||||
+}
|
||||
+
|
||||
+static void update_child_burst_topological(
|
||||
+ struct task_struct *p, u64 now, u32 depth, u32 *acnt, u32 *asum) {
|
||||
+ struct task_struct *child, *dec;
|
||||
+ u32 cnt = 0, dcnt = 0;
|
||||
@ -139,7 +157,7 @@ index a854b7183..a98cfa7ab 100644
|
||||
+ dec = list_first_entry(&dec->children, struct task_struct, sibling);
|
||||
+
|
||||
+ if (!dcnt || !depth) {
|
||||
+ if (dec->sched_class != &fair_sched_class) continue;
|
||||
+ if (!task_is_inheritable(dec)) continue;
|
||||
+ cnt++;
|
||||
+ sum += dec->se.burst_penalty;
|
||||
+ continue;
|
||||
@ -149,7 +167,7 @@ index a854b7183..a98cfa7ab 100644
|
||||
+ sum += (u32)dec->se.child_burst * dec->se.child_burst_cnt;
|
||||
+ continue;
|
||||
+ }
|
||||
+ update_child_burst_cache_atavistic(dec, now, depth - 1, &cnt, &sum);
|
||||
+ update_child_burst_topological(dec, now, depth - 1, &cnt, &sum);
|
||||
+ }
|
||||
+
|
||||
+ __update_child_burst_cache(p, cnt, sum, now);
|
||||
@ -157,42 +175,44 @@ index a854b7183..a98cfa7ab 100644
|
||||
+ *asum += sum;
|
||||
+}
|
||||
+
|
||||
+static void sched_post_fork_bore(struct task_struct *p) {
|
||||
+ struct sched_entity *se = &p->se;
|
||||
+ struct task_struct *anc;
|
||||
+ u64 now;
|
||||
+ u32 cnt = 0, sum = 0, depth;
|
||||
+ u8 burst_cache;
|
||||
+static inline u8 __inherit_burst_topological(struct task_struct *p, u64 now) {
|
||||
+ struct task_struct *anc = p->real_parent;
|
||||
+ u32 cnt = 0, sum = 0;
|
||||
+
|
||||
+ if (likely(sched_bore)) {
|
||||
+ now = ktime_get_ns();
|
||||
+ read_lock(&tasklist_lock);
|
||||
+
|
||||
+ anc = p->real_parent;
|
||||
+ depth = sched_burst_fork_atavistic;
|
||||
+ if (likely(depth)) {
|
||||
+ while ((anc->real_parent != anc) && (count_child_tasks(anc) == 1))
|
||||
+ while (anc->real_parent != anc && count_child_tasks(anc) == 1)
|
||||
+ anc = anc->real_parent;
|
||||
+ if (child_burst_cache_expired(anc, now))
|
||||
+ update_child_burst_cache_atavistic(
|
||||
+ anc, now, depth - 1, &cnt, &sum);
|
||||
+ } else
|
||||
+ if (child_burst_cache_expired(anc, now))
|
||||
+ update_child_burst_cache(anc, now);
|
||||
+
|
||||
+ burst_cache = anc->se.child_burst;
|
||||
+ if (child_burst_cache_expired(anc, now))
|
||||
+ update_child_burst_topological(
|
||||
+ anc, now, sched_burst_fork_atavistic - 1, &cnt, &sum);
|
||||
+
|
||||
+ return anc->se.child_burst;
|
||||
+}
|
||||
+
|
||||
+static inline void inherit_burst(struct task_struct *p) {
|
||||
+ u8 burst_cache;
|
||||
+ u64 now = ktime_get_ns();
|
||||
+
|
||||
+ read_lock(&tasklist_lock);
|
||||
+ burst_cache = likely(sched_burst_fork_atavistic)?
|
||||
+ __inherit_burst_topological(p, now):
|
||||
+ __inherit_burst_direct(p, now);
|
||||
+ read_unlock(&tasklist_lock);
|
||||
+ se->prev_burst_penalty = max(se->prev_burst_penalty, burst_cache);
|
||||
+ }
|
||||
+ se->burst_penalty = se->prev_burst_penalty;
|
||||
+
|
||||
+ p->se.prev_burst_penalty = max(p->se.prev_burst_penalty, burst_cache);
|
||||
+}
|
||||
+
|
||||
+static void sched_post_fork_bore(struct task_struct *p) {
|
||||
+ if (p->sched_class == &fair_sched_class && likely(sched_bore))
|
||||
+ inherit_burst(p);
|
||||
+ p->se.burst_penalty = p->se.prev_burst_penalty;
|
||||
+}
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
+
|
||||
/*
|
||||
* Perform scheduler related setup for a newly forked process p.
|
||||
* p is forked by current.
|
||||
@@ -4504,6 +4621,9 @@ static void __sched_fork(unsigned long clone_flags, struct task_struct *p)
|
||||
@@ -4523,6 +4658,9 @@ static void __sched_fork(unsigned long clone_flags, struct task_struct *p)
|
||||
p->se.prev_sum_exec_runtime = 0;
|
||||
p->se.nr_migrations = 0;
|
||||
p->se.vruntime = 0;
|
||||
@ -202,7 +222,7 @@ index a854b7183..a98cfa7ab 100644
|
||||
p->se.vlag = 0;
|
||||
p->se.slice = sysctl_sched_base_slice;
|
||||
INIT_LIST_HEAD(&p->se.group_node);
|
||||
@@ -4823,6 +4943,9 @@ void sched_cgroup_fork(struct task_struct *p, struct kernel_clone_args *kargs)
|
||||
@@ -4839,6 +4977,9 @@ void sched_cgroup_fork(struct task_struct *p, struct kernel_clone_args *kargs)
|
||||
|
||||
void sched_post_fork(struct task_struct *p)
|
||||
{
|
||||
@ -212,34 +232,117 @@ index a854b7183..a98cfa7ab 100644
|
||||
uclamp_post_fork(p);
|
||||
}
|
||||
|
||||
@@ -9922,6 +10045,11 @@ void __init sched_init(void)
|
||||
@@ -9910,6 +10051,11 @@ void __init sched_init(void)
|
||||
BUG_ON(&dl_sched_class != &stop_sched_class + 1);
|
||||
#endif
|
||||
|
||||
+#ifdef CONFIG_SCHED_BORE
|
||||
+ sched_init_bore();
|
||||
+ printk(KERN_INFO "BORE (Burst-Oriented Response Enhancer) CPU Scheduler modification 3.5.7 by Masahito Suzuki");
|
||||
+ printk(KERN_INFO "BORE (Burst-Oriented Response Enhancer) CPU Scheduler modification 4.2.4 by Masahito Suzuki");
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
+
|
||||
wait_bit_init();
|
||||
|
||||
#ifdef CONFIG_FAIR_GROUP_SCHED
|
||||
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c
|
||||
index 4c3d0d9f3..e37fdfad1 100644
|
||||
index 8d5d98a58..3f37534f8 100644
|
||||
--- a/kernel/sched/debug.c
|
||||
+++ b/kernel/sched/debug.c
|
||||
@@ -595,6 +595,9 @@ print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
|
||||
@@ -167,7 +167,52 @@ static const struct file_operations sched_feat_fops = {
|
||||
};
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
+#ifdef CONFIG_SCHED_BORE
|
||||
+static ssize_t sched_min_base_slice_write(struct file *filp, const char __user *ubuf,
|
||||
+ size_t cnt, loff_t *ppos)
|
||||
+{
|
||||
+ char buf[16];
|
||||
+ unsigned int value;
|
||||
+
|
||||
+ if (cnt > 15)
|
||||
+ cnt = 15;
|
||||
+
|
||||
+ if (copy_from_user(&buf, ubuf, cnt))
|
||||
+ return -EFAULT;
|
||||
+ buf[cnt] = '\0';
|
||||
+
|
||||
+ if (kstrtouint(buf, 10, &value))
|
||||
+ return -EINVAL;
|
||||
|
||||
+ if (!value)
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ sysctl_sched_min_base_slice = value;
|
||||
+ sched_update_min_base_slice();
|
||||
+
|
||||
+ *ppos += cnt;
|
||||
+ return cnt;
|
||||
+}
|
||||
+
|
||||
+static int sched_min_base_slice_show(struct seq_file *m, void *v)
|
||||
+{
|
||||
+ seq_printf(m, "%d\n", sysctl_sched_min_base_slice);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int sched_min_base_slice_open(struct inode *inode, struct file *filp)
|
||||
+{
|
||||
+ return single_open(filp, sched_min_base_slice_show, NULL);
|
||||
+}
|
||||
+
|
||||
+static const struct file_operations sched_min_base_slice_fops = {
|
||||
+ .open = sched_min_base_slice_open,
|
||||
+ .write = sched_min_base_slice_write,
|
||||
+ .read = seq_read,
|
||||
+ .llseek = seq_lseek,
|
||||
+ .release = single_release,
|
||||
+};
|
||||
+#else // !CONFIG_SCHED_BORE
|
||||
static ssize_t sched_scaling_write(struct file *filp, const char __user *ubuf,
|
||||
size_t cnt, loff_t *ppos)
|
||||
{
|
||||
@@ -213,7 +258,7 @@ static const struct file_operations sched_scaling_fops = {
|
||||
.llseek = seq_lseek,
|
||||
.release = single_release,
|
||||
};
|
||||
-
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
#endif /* SMP */
|
||||
|
||||
#ifdef CONFIG_PREEMPT_DYNAMIC
|
||||
@@ -347,13 +392,20 @@ static __init int sched_init_debug(void)
|
||||
debugfs_create_file("preempt", 0644, debugfs_sched, NULL, &sched_dynamic_fops);
|
||||
#endif
|
||||
|
||||
+#ifdef CONFIG_SCHED_BORE
|
||||
+ debugfs_create_file("min_base_slice_ns", 0644, debugfs_sched, NULL, &sched_min_base_slice_fops);
|
||||
+ debugfs_create_u32("base_slice_ns", 0400, debugfs_sched, &sysctl_sched_base_slice);
|
||||
+#else // !CONFIG_SCHED_BORE
|
||||
debugfs_create_u32("base_slice_ns", 0644, debugfs_sched, &sysctl_sched_base_slice);
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
|
||||
debugfs_create_u32("latency_warn_ms", 0644, debugfs_sched, &sysctl_resched_latency_warn_ms);
|
||||
debugfs_create_u32("latency_warn_once", 0644, debugfs_sched, &sysctl_resched_latency_warn_once);
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
+#if !defined(CONFIG_SCHED_BORE)
|
||||
debugfs_create_file("tunable_scaling", 0644, debugfs_sched, NULL, &sched_scaling_fops);
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
debugfs_create_u32("migration_cost_ns", 0644, debugfs_sched, &sysctl_sched_migration_cost);
|
||||
debugfs_create_u32("nr_migrate", 0644, debugfs_sched, &sysctl_sched_nr_migrate);
|
||||
|
||||
@@ -595,6 +647,9 @@ print_task(struct seq_file *m, struct rq *rq, struct task_struct *p)
|
||||
SPLIT_NS(schedstat_val_or_zero(p->stats.sum_sleep_runtime)),
|
||||
SPLIT_NS(schedstat_val_or_zero(p->stats.sum_block_runtime)));
|
||||
|
||||
+#ifdef CONFIG_SCHED_BORE
|
||||
+ SEQ_printf(m, " %2d", p->se.slice_score);
|
||||
+#endif
|
||||
+ SEQ_printf(m, " %2d", p->se.burst_score);
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
#ifdef CONFIG_NUMA_BALANCING
|
||||
SEQ_printf(m, " %d %d", task_node(p), task_numa_group_id(p));
|
||||
#endif
|
||||
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
|
||||
index fa9fff0f9..5e4f0ccff 100644
|
||||
index fc0a9de42..f85eab965 100644
|
||||
--- a/kernel/sched/fair.c
|
||||
+++ b/kernel/sched/fair.c
|
||||
@@ -19,6 +19,9 @@
|
||||
@ -248,11 +351,11 @@ index fa9fff0f9..5e4f0ccff 100644
|
||||
* Copyright (C) 2007 Red Hat, Inc., Peter Zijlstra
|
||||
+ *
|
||||
+ * Burst-Oriented Response Enhancer (BORE) CPU Scheduler
|
||||
+ * Copyright (C) 2021-2023 Masahito Suzuki <firelzrd@gmail.com>
|
||||
+ * Copyright (C) 2021-2024 Masahito Suzuki <firelzrd@gmail.com>
|
||||
*/
|
||||
#include <linux/energy_model.h>
|
||||
#include <linux/mmap_lock.h>
|
||||
@@ -66,17 +69,28 @@
|
||||
@@ -64,28 +67,126 @@
|
||||
* SCHED_TUNABLESCALING_LOG - scaled logarithmical, *1+ilog(ncpus)
|
||||
* SCHED_TUNABLESCALING_LINEAR - scaled linear, *ncpus
|
||||
*
|
||||
@ -262,7 +365,7 @@ index fa9fff0f9..5e4f0ccff 100644
|
||||
*/
|
||||
+#ifdef CONFIG_SCHED_BORE
|
||||
+unsigned int sysctl_sched_tunable_scaling = SCHED_TUNABLESCALING_NONE;
|
||||
+#else // CONFIG_SCHED_BORE
|
||||
+#else // !CONFIG_SCHED_BORE
|
||||
unsigned int sysctl_sched_tunable_scaling = SCHED_TUNABLESCALING_LOG;
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
|
||||
@ -270,34 +373,40 @@ index fa9fff0f9..5e4f0ccff 100644
|
||||
* Minimal preemption granularity for CPU-bound tasks:
|
||||
*
|
||||
- * (default: 0.75 msec * (1 + ilog(ncpus)), units: nanoseconds)
|
||||
+ * (BORE default: 3 msec constant, units: nanoseconds)
|
||||
+ * (BORE default: max(1 sec / HZ, min_base_slice) constant, units: nanoseconds)
|
||||
+ * (EEVDF default: 0.75 msec * (1 + ilog(ncpus)), units: nanoseconds)
|
||||
*/
|
||||
-#ifdef CONFIG_CACHY
|
||||
-unsigned int sysctl_sched_base_slice = 350000ULL;
|
||||
-static unsigned int normalized_sysctl_sched_base_slice = 350000ULL;
|
||||
-#else
|
||||
+#ifdef CONFIG_SCHED_BORE
|
||||
+unsigned int sysctl_sched_base_slice = 3000000ULL;
|
||||
+static unsigned int normalized_sysctl_sched_base_slice = 3000000ULL;
|
||||
+#else // CONFIG_SCHED_BORE
|
||||
+unsigned int sysctl_sched_base_slice = 1000000000ULL / HZ;
|
||||
+static unsigned int configured_sched_base_slice = 1000000000ULL / HZ;
|
||||
+unsigned int sysctl_sched_min_base_slice = 2000000ULL;
|
||||
+#else // !CONFIG_SCHED_BORE
|
||||
unsigned int sysctl_sched_base_slice = 750000ULL;
|
||||
static unsigned int normalized_sysctl_sched_base_slice = 750000ULL;
|
||||
-#endif
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
|
||||
/*
|
||||
* After fork, child runs first. If set to 0 (default) then
|
||||
@@ -86,6 +100,68 @@ unsigned int sysctl_sched_child_runs_first __read_mostly;
|
||||
|
||||
-#ifdef CONFIG_CACHY
|
||||
-const_debug unsigned int sysctl_sched_migration_cost = 300000UL;
|
||||
-#else
|
||||
const_debug unsigned int sysctl_sched_migration_cost = 500000UL;
|
||||
|
||||
-#endif
|
||||
+
|
||||
+#ifdef CONFIG_SCHED_BORE
|
||||
+bool __read_mostly sched_bore = 1;
|
||||
+bool __read_mostly sched_burst_score_rounding = 0;
|
||||
+bool __read_mostly sched_burst_smoothness_long = 1;
|
||||
+bool __read_mostly sched_burst_smoothness_short = 0;
|
||||
+u8 __read_mostly sched_bore = 1;
|
||||
+u8 __read_mostly sched_burst_score_rounding = 0;
|
||||
+u8 __read_mostly sched_burst_smoothness_long = 1;
|
||||
+u8 __read_mostly sched_burst_smoothness_short = 0;
|
||||
+u8 __read_mostly sched_burst_fork_atavistic = 2;
|
||||
+u8 __read_mostly sched_burst_penalty_offset = 22;
|
||||
+uint __read_mostly sched_burst_penalty_scale = 1280;
|
||||
+uint __read_mostly sched_burst_cache_lifetime = 60000000;
|
||||
+static u8 sixty_four = 64;
|
||||
+static uint maxval_12_bits = 4095;
|
||||
+static int __maybe_unused sixty_four = 64;
|
||||
+static int __maybe_unused maxval_12_bits = 4095;
|
||||
+
|
||||
+#define MAX_BURST_PENALTY (39U <<2)
|
||||
+
|
||||
@ -319,19 +428,38 @@ index fa9fff0f9..5e4f0ccff 100644
|
||||
+ return min(MAX_BURST_PENALTY, scaled_penalty);
|
||||
+}
|
||||
+
|
||||
+static inline void update_burst_penalty(struct sched_entity *se) {
|
||||
+ se->curr_burst_penalty = calc_burst_penalty(se->burst_time);
|
||||
+ se->burst_penalty = max(se->prev_burst_penalty, se->curr_burst_penalty);
|
||||
+static inline u64 scale_slice(u64 delta, struct sched_entity *se) {
|
||||
+ return mul_u64_u32_shr(delta, sched_prio_to_wmult[se->burst_score], 22);
|
||||
+}
|
||||
+
|
||||
+static inline void update_slice_score(struct sched_entity *se) {
|
||||
+static inline u64 __unscale_slice(u64 delta, u8 score) {
|
||||
+ return mul_u64_u32_shr(delta, sched_prio_to_weight[score], 10);
|
||||
+}
|
||||
+
|
||||
+static inline u64 unscale_slice(u64 delta, struct sched_entity *se) {
|
||||
+ return __unscale_slice(delta, se->burst_score);
|
||||
+}
|
||||
+
|
||||
+static void avg_vruntime_add(struct cfs_rq *cfs_rq, struct sched_entity *se);
|
||||
+static void avg_vruntime_sub(struct cfs_rq *cfs_rq, struct sched_entity *se);
|
||||
+
|
||||
+static void update_burst_score(struct sched_entity *se) {
|
||||
+ struct cfs_rq *cfs_rq = cfs_rq_of(se);
|
||||
+ u8 prev_score = se->burst_score;
|
||||
+ u32 penalty = se->burst_penalty;
|
||||
+ if (sched_burst_score_rounding) penalty += 0x2U;
|
||||
+ se->slice_score = penalty >> 2;
|
||||
+ se->burst_score = penalty >> 2;
|
||||
+
|
||||
+ if ((se->burst_score != prev_score) && se->burst_load) {
|
||||
+ avg_vruntime_sub(cfs_rq, se);
|
||||
+ avg_vruntime_add(cfs_rq, se);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static inline u64 scale_slice(u64 delta, struct sched_entity *se) {
|
||||
+ return mul_u64_u32_shr(delta, sched_prio_to_wmult[se->slice_score], 22);
|
||||
+static void update_burst_penalty(struct sched_entity *se) {
|
||||
+ se->curr_burst_penalty = calc_burst_penalty(se->burst_time);
|
||||
+ se->burst_penalty = max(se->prev_burst_penalty, se->curr_burst_penalty);
|
||||
+ update_burst_score(se);
|
||||
+}
|
||||
+
|
||||
+static inline u32 binary_smooth(u32 new, u32 old) {
|
||||
@ -346,13 +474,39 @@ index fa9fff0f9..5e4f0ccff 100644
|
||||
+ binary_smooth(se->curr_burst_penalty, se->prev_burst_penalty);
|
||||
+ se->curr_burst_penalty = 0;
|
||||
+ se->burst_time = 0;
|
||||
+ update_burst_score(se);
|
||||
+}
|
||||
+
|
||||
+static void restart_burst_rescale_deadline(struct sched_entity *se) {
|
||||
+ s64 vscaled, wremain, vremain = se->deadline - se->vruntime;
|
||||
+ u8 prev_score = se->burst_score;
|
||||
+ restart_burst(se);
|
||||
+ if (prev_score > se->burst_score) {
|
||||
+ wremain = __unscale_slice(abs(vremain), prev_score);
|
||||
+ vscaled = scale_slice(wremain, se);
|
||||
+ if (unlikely(vremain < 0))
|
||||
+ vscaled = -vscaled;
|
||||
+ se->deadline = se->vruntime + vscaled;
|
||||
+ }
|
||||
+}
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
+
|
||||
|
||||
int sched_thermal_decay_shift;
|
||||
static int __init setup_sched_thermal_decay_shift(char *str)
|
||||
{
|
||||
@@ -145,6 +221,70 @@ static unsigned int sysctl_numa_balancing_promote_rate_limit = 65536;
|
||||
@@ -136,12 +237,8 @@ int __weak arch_asym_cpu_priority(int cpu)
|
||||
*
|
||||
* (default: 5 msec, units: microseconds)
|
||||
*/
|
||||
-#ifdef CONFIG_CACHY
|
||||
-static unsigned int sysctl_sched_cfs_bandwidth_slice = 3000UL;
|
||||
-#else
|
||||
static unsigned int sysctl_sched_cfs_bandwidth_slice = 5000UL;
|
||||
#endif
|
||||
-#endif
|
||||
|
||||
#ifdef CONFIG_NUMA_BALANCING
|
||||
/* Restrict the NUMA promotion throughput (MB/s) for each target node. */
|
||||
@@ -150,6 +247,78 @@ static unsigned int sysctl_numa_balancing_promote_rate_limit = 65536;
|
||||
|
||||
#ifdef CONFIG_SYSCTL
|
||||
static struct ctl_table sched_fair_sysctls[] = {
|
||||
@ -360,23 +514,45 @@ index fa9fff0f9..5e4f0ccff 100644
|
||||
+ {
|
||||
+ .procname = "sched_bore",
|
||||
+ .data = &sched_bore,
|
||||
+ .maxlen = sizeof(bool),
|
||||
+ .maxlen = sizeof(u8),
|
||||
+ .mode = 0644,
|
||||
+ .proc_handler = &proc_dobool,
|
||||
+ .proc_handler = proc_dou8vec_minmax,
|
||||
+ .extra1 = SYSCTL_ZERO,
|
||||
+ .extra2 = SYSCTL_ONE,
|
||||
+ },
|
||||
+ {
|
||||
+ .procname = "sched_burst_cache_lifetime",
|
||||
+ .data = &sched_burst_cache_lifetime,
|
||||
+ .maxlen = sizeof(uint),
|
||||
+ .procname = "sched_burst_score_rounding",
|
||||
+ .data = &sched_burst_score_rounding,
|
||||
+ .maxlen = sizeof(u8),
|
||||
+ .mode = 0644,
|
||||
+ .proc_handler = proc_douintvec,
|
||||
+ .proc_handler = proc_dou8vec_minmax,
|
||||
+ .extra1 = SYSCTL_ZERO,
|
||||
+ .extra2 = SYSCTL_ONE,
|
||||
+ },
|
||||
+ {
|
||||
+ .procname = "sched_burst_smoothness_long",
|
||||
+ .data = &sched_burst_smoothness_long,
|
||||
+ .maxlen = sizeof(u8),
|
||||
+ .mode = 0644,
|
||||
+ .proc_handler = proc_dou8vec_minmax,
|
||||
+ .extra1 = SYSCTL_ZERO,
|
||||
+ .extra2 = SYSCTL_ONE,
|
||||
+ },
|
||||
+ {
|
||||
+ .procname = "sched_burst_smoothness_short",
|
||||
+ .data = &sched_burst_smoothness_short,
|
||||
+ .maxlen = sizeof(u8),
|
||||
+ .mode = 0644,
|
||||
+ .proc_handler = proc_dou8vec_minmax,
|
||||
+ .extra1 = SYSCTL_ZERO,
|
||||
+ .extra2 = SYSCTL_ONE,
|
||||
+ },
|
||||
+ {
|
||||
+ .procname = "sched_burst_fork_atavistic",
|
||||
+ .data = &sched_burst_fork_atavistic,
|
||||
+ .maxlen = sizeof(u8),
|
||||
+ .mode = 0644,
|
||||
+ .proc_handler = &proc_dou8vec_minmax,
|
||||
+ .proc_handler = proc_dou8vec_minmax,
|
||||
+ .extra1 = SYSCTL_ZERO,
|
||||
+ .extra2 = SYSCTL_THREE,
|
||||
+ },
|
||||
@ -385,7 +561,7 @@ index fa9fff0f9..5e4f0ccff 100644
|
||||
+ .data = &sched_burst_penalty_offset,
|
||||
+ .maxlen = sizeof(u8),
|
||||
+ .mode = 0644,
|
||||
+ .proc_handler = &proc_dou8vec_minmax,
|
||||
+ .proc_handler = proc_dou8vec_minmax,
|
||||
+ .extra1 = SYSCTL_ZERO,
|
||||
+ .extra2 = &sixty_four,
|
||||
+ },
|
||||
@ -394,36 +570,44 @@ index fa9fff0f9..5e4f0ccff 100644
|
||||
+ .data = &sched_burst_penalty_scale,
|
||||
+ .maxlen = sizeof(uint),
|
||||
+ .mode = 0644,
|
||||
+ .proc_handler = &proc_douintvec_minmax,
|
||||
+ .proc_handler = proc_douintvec_minmax,
|
||||
+ .extra1 = SYSCTL_ZERO,
|
||||
+ .extra2 = &maxval_12_bits,
|
||||
+ },
|
||||
+ {
|
||||
+ .procname = "sched_burst_score_rounding",
|
||||
+ .data = &sched_burst_score_rounding,
|
||||
+ .maxlen = sizeof(bool),
|
||||
+ .procname = "sched_burst_cache_lifetime",
|
||||
+ .data = &sched_burst_cache_lifetime,
|
||||
+ .maxlen = sizeof(uint),
|
||||
+ .mode = 0644,
|
||||
+ .proc_handler = &proc_dobool,
|
||||
+ },
|
||||
+ {
|
||||
+ .procname = "sched_burst_smoothness_long",
|
||||
+ .data = &sched_burst_smoothness_long,
|
||||
+ .maxlen = sizeof(bool),
|
||||
+ .mode = 0644,
|
||||
+ .proc_handler = &proc_dobool,
|
||||
+ },
|
||||
+ {
|
||||
+ .procname = "sched_burst_smoothness_short",
|
||||
+ .data = &sched_burst_smoothness_short,
|
||||
+ .maxlen = sizeof(bool),
|
||||
+ .mode = 0644,
|
||||
+ .proc_handler = &proc_dobool,
|
||||
+ .proc_handler = proc_douintvec,
|
||||
+ },
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
#ifdef CONFIG_CFS_BANDWIDTH
|
||||
{
|
||||
.procname = "sched_child_runs_first",
|
||||
.data = &sysctl_sched_child_runs_first,
|
||||
@@ -313,6 +453,9 @@ static inline u64 calc_delta_fair(u64 delta, struct sched_entity *se)
|
||||
.procname = "sched_cfs_bandwidth_slice_us",
|
||||
@@ -208,6 +377,13 @@ static inline void update_load_set(struct load_weight *lw, unsigned long w)
|
||||
*
|
||||
* This idea comes from the SD scheduler of Con Kolivas:
|
||||
*/
|
||||
+#ifdef CONFIG_SCHED_BORE
|
||||
+static void update_sysctl(void) {
|
||||
+ sysctl_sched_base_slice =
|
||||
+ max(sysctl_sched_min_base_slice, configured_sched_base_slice);
|
||||
+}
|
||||
+void sched_update_min_base_slice(void) { update_sysctl(); }
|
||||
+#else // !CONFIG_SCHED_BORE
|
||||
static unsigned int get_update_sysctl_factor(void)
|
||||
{
|
||||
unsigned int cpus = min_t(unsigned int, num_online_cpus(), 8);
|
||||
@@ -238,6 +414,7 @@ static void update_sysctl(void)
|
||||
SET_SYSCTL(sched_base_slice);
|
||||
#undef SET_SYSCTL
|
||||
}
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
|
||||
void __init sched_init_granularity(void)
|
||||
{
|
||||
@@ -311,6 +488,9 @@ static inline u64 calc_delta_fair(u64 delta, struct sched_entity *se)
|
||||
if (unlikely(se->load.weight != NICE_0_LOAD))
|
||||
delta = __calc_delta(delta, NICE_0_LOAD, &se->load);
|
||||
|
||||
@ -433,170 +617,194 @@ index fa9fff0f9..5e4f0ccff 100644
|
||||
return delta;
|
||||
}
|
||||
|
||||
@@ -668,7 +811,7 @@ void avg_vruntime_update(struct cfs_rq *cfs_rq, s64 delta)
|
||||
* Specifically: avg_runtime() + 0 must result in entity_eligible() := true
|
||||
* For this to be so, the result of this function must have a left bias.
|
||||
@@ -637,10 +817,26 @@ static inline s64 entity_key(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
||||
*
|
||||
* As measured, the max (key * weight) value was ~44 bits for a kernel build.
|
||||
*/
|
||||
-u64 avg_vruntime(struct cfs_rq *cfs_rq)
|
||||
+static u64 avg_key(struct cfs_rq *cfs_rq)
|
||||
{
|
||||
struct sched_entity *curr = cfs_rq->curr;
|
||||
s64 avg = cfs_rq->avg_vruntime;
|
||||
@@ -688,7 +831,11 @@ u64 avg_vruntime(struct cfs_rq *cfs_rq)
|
||||
avg = div_s64(avg, load);
|
||||
}
|
||||
|
||||
- return cfs_rq->min_vruntime + avg;
|
||||
+ return avg;
|
||||
+#if !defined(CONFIG_SCHED_BORE)
|
||||
+#define entity_weight(se) scale_load_down(se->load.weight)
|
||||
+#else // CONFIG_SCHED_BORE
|
||||
+static unsigned long entity_weight(struct sched_entity *se) {
|
||||
+ unsigned long weight = se->load.weight;
|
||||
+ if (likely(weight && sched_bore)) weight = unscale_slice(weight, se);
|
||||
+#ifdef CONFIG_64BIT
|
||||
+ weight >>= SCHED_FIXEDPOINT_SHIFT - 5;
|
||||
+#endif // CONFIG_64BIT
|
||||
+ return max(1UL, weight);
|
||||
+}
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
+
|
||||
+inline u64 avg_vruntime(struct cfs_rq *cfs_rq) {
|
||||
+ return cfs_rq->min_vruntime + avg_key(cfs_rq);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -709,13 +856,8 @@ u64 avg_vruntime(struct cfs_rq *cfs_rq)
|
||||
*/
|
||||
static void update_entity_lag(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
||||
static void
|
||||
avg_vruntime_add(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
||||
{
|
||||
- s64 lag, limit;
|
||||
-
|
||||
SCHED_WARN_ON(!se->on_rq);
|
||||
- lag = avg_vruntime(cfs_rq) - se->vruntime;
|
||||
-
|
||||
- limit = calc_delta_fair(max_t(u64, 2*se->slice, TICK_NSEC), se);
|
||||
- se->vlag = clamp(lag, -limit, limit);
|
||||
+ se->vlag = avg_vruntime(cfs_rq) - se->vruntime;
|
||||
}
|
||||
- unsigned long weight = scale_load_down(se->load.weight);
|
||||
+ unsigned long weight = entity_weight(se);
|
||||
+#ifdef CONFIG_SCHED_BORE
|
||||
+ se->burst_load = weight;
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
s64 key = entity_key(cfs_rq, se);
|
||||
|
||||
/*
|
||||
@@ -981,7 +1123,6 @@ static struct sched_entity *pick_eevdf(struct cfs_rq *cfs_rq)
|
||||
return se;
|
||||
}
|
||||
|
||||
-#ifdef CONFIG_SCHED_DEBUG
|
||||
struct sched_entity *__pick_last_entity(struct cfs_rq *cfs_rq)
|
||||
cfs_rq->avg_vruntime += key * weight;
|
||||
@@ -650,7 +846,12 @@ avg_vruntime_add(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
||||
static void
|
||||
avg_vruntime_sub(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
||||
{
|
||||
struct rb_node *last = rb_last(&cfs_rq->tasks_timeline.rb_root);
|
||||
@@ -995,6 +1136,7 @@ struct sched_entity *__pick_last_entity(struct cfs_rq *cfs_rq)
|
||||
/**************************************************************
|
||||
- unsigned long weight = scale_load_down(se->load.weight);
|
||||
+#if !defined(CONFIG_SCHED_BORE)
|
||||
+ unsigned long weight = entity_weight(se);
|
||||
+#else // CONFIG_SCHED_BORE
|
||||
+ unsigned long weight = se->burst_load;
|
||||
+ se->burst_load = 0;
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
s64 key = entity_key(cfs_rq, se);
|
||||
|
||||
cfs_rq->avg_vruntime -= key * weight;
|
||||
@@ -677,7 +878,7 @@ u64 avg_vruntime(struct cfs_rq *cfs_rq)
|
||||
long load = cfs_rq->avg_load;
|
||||
|
||||
if (curr && curr->on_rq) {
|
||||
- unsigned long weight = scale_load_down(curr->load.weight);
|
||||
+ unsigned long weight = entity_weight(curr);
|
||||
|
||||
avg += entity_key(cfs_rq, curr) * weight;
|
||||
load += weight;
|
||||
@@ -687,7 +888,7 @@ u64 avg_vruntime(struct cfs_rq *cfs_rq)
|
||||
/* sign flips effective floor / ceil */
|
||||
if (avg < 0)
|
||||
avg -= (load - 1);
|
||||
- avg = div_s64(avg, load);
|
||||
+ avg = div64_s64(avg, load);
|
||||
}
|
||||
|
||||
return cfs_rq->min_vruntime + avg;
|
||||
@@ -717,6 +918,9 @@ static void update_entity_lag(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
||||
lag = avg_vruntime(cfs_rq) - se->vruntime;
|
||||
|
||||
limit = calc_delta_fair(max_t(u64, 2*se->slice, TICK_NSEC), se);
|
||||
+#ifdef CONFIG_SCHED_BORE
|
||||
+ if (likely(sched_bore)) limit >>= 1;
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
se->vlag = clamp(lag, -limit, limit);
|
||||
}
|
||||
|
||||
@@ -744,7 +948,7 @@ static int vruntime_eligible(struct cfs_rq *cfs_rq, u64 vruntime)
|
||||
long load = cfs_rq->avg_load;
|
||||
|
||||
if (curr && curr->on_rq) {
|
||||
- unsigned long weight = scale_load_down(curr->load.weight);
|
||||
+ unsigned long weight = entity_weight(curr);
|
||||
|
||||
avg += entity_key(cfs_rq, curr) * weight;
|
||||
load += weight;
|
||||
@@ -968,6 +1172,7 @@ struct sched_entity *__pick_last_entity(struct cfs_rq *cfs_rq)
|
||||
* Scheduling class statistics methods:
|
||||
*/
|
||||
+#ifdef CONFIG_SCHED_DEBUG
|
||||
#ifdef CONFIG_SMP
|
||||
+#if !defined(CONFIG_SCHED_BORE)
|
||||
int sched_update_scaling(void)
|
||||
{
|
||||
@@ -1031,6 +1173,9 @@ static void update_deadline(struct cfs_rq *cfs_rq, struct sched_entity *se)
|
||||
/*
|
||||
* EEVDF: vd_i = ve_i + r_i / w_i
|
||||
*/
|
||||
+#ifdef CONFIG_SCHED_BORE
|
||||
+ update_slice_score(se);
|
||||
unsigned int factor = get_update_sysctl_factor();
|
||||
@@ -979,6 +1184,7 @@ int sched_update_scaling(void)
|
||||
|
||||
return 0;
|
||||
}
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
se->deadline = se->vruntime + calc_delta_fair(se->slice, se);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -1173,7 +1318,11 @@ static void update_curr(struct cfs_rq *cfs_rq)
|
||||
curr->sum_exec_runtime += delta_exec;
|
||||
schedstat_add(cfs_rq->exec_clock, delta_exec);
|
||||
@@ -1178,7 +1384,13 @@ static void update_curr(struct cfs_rq *cfs_rq)
|
||||
if (unlikely(delta_exec <= 0))
|
||||
return;
|
||||
|
||||
- curr->vruntime += calc_delta_fair(delta_exec, curr);
|
||||
+#ifdef CONFIG_SCHED_BORE
|
||||
+ curr->burst_time += delta_exec;
|
||||
+ update_burst_penalty(curr);
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
+ curr->vruntime += max(1ULL, calc_delta_fair(delta_exec, curr));
|
||||
+#else // !CONFIG_SCHED_BORE
|
||||
curr->vruntime += calc_delta_fair(delta_exec, curr);
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
update_deadline(cfs_rq, curr);
|
||||
update_min_vruntime(cfs_rq);
|
||||
|
||||
@@ -5066,6 +5215,9 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
|
||||
s64 lag = 0;
|
||||
|
||||
se->slice = sysctl_sched_base_slice;
|
||||
@@ -3787,6 +3999,9 @@ static void reweight_eevdf(struct cfs_rq *cfs_rq, struct sched_entity *se,
|
||||
*/
|
||||
vslice = (s64)(se->deadline - avruntime);
|
||||
vslice = div_s64(vslice * old_weight, weight);
|
||||
+#ifdef CONFIG_SCHED_BORE
|
||||
+ update_slice_score(se);
|
||||
+ if (unlikely(!sched_bore) || (s64)(avruntime + vslice - se->deadline) < 0)
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
vslice = calc_delta_fair(se->slice, se);
|
||||
se->deadline = avruntime + vslice;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5080,7 +5232,13 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
|
||||
struct sched_entity *curr = cfs_rq->curr;
|
||||
unsigned long load;
|
||||
@@ -5244,12 +5459,12 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
|
||||
*/
|
||||
load = cfs_rq->avg_load;
|
||||
if (curr && curr->on_rq)
|
||||
- load += scale_load_down(curr->load.weight);
|
||||
+ load += entity_weight(curr);
|
||||
|
||||
- lag = se->vlag;
|
||||
+ u64 slice = se->slice;
|
||||
+#ifdef CONFIG_SCHED_BORE
|
||||
+ if (unlikely(!sched_bore))
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
+ slice *= 2;
|
||||
+ s64 limit = calc_delta_fair(max_t(u64, slice, TICK_NSEC), se);
|
||||
+ lag = clamp(se->vlag, -limit, limit);
|
||||
|
||||
/*
|
||||
* If we want to place a task and preserve lag, we have to
|
||||
@@ -5142,6 +5300,21 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags)
|
||||
- lag *= load + scale_load_down(se->load.weight);
|
||||
+ lag *= load + entity_weight(se);
|
||||
if (WARN_ON_ONCE(!load))
|
||||
load = 1;
|
||||
lag = div_s64(lag, load);
|
||||
+
|
||||
+#ifdef CONFIG_SCHED_BORE
|
||||
+ if (flags & ENQUEUE_MIGRATED && likely(sched_bore)) {
|
||||
+ s64 left_vruntime = vruntime, right_vruntime = vruntime;
|
||||
+ struct sched_entity *first = __pick_first_entity(cfs_rq),
|
||||
+ *last = __pick_last_entity(cfs_rq);
|
||||
+
|
||||
+ if (first) left_vruntime = first->vruntime;
|
||||
+ if (last) right_vruntime = last->vruntime;
|
||||
+
|
||||
+ lag = clamp(lag,
|
||||
+ (s64)vruntime - right_vruntime,
|
||||
+ (s64)vruntime - left_vruntime);
|
||||
+ }
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
- lag = div_s64(lag, load);
|
||||
+ lag = div64_s64(lag, load);
|
||||
}
|
||||
|
||||
se->vruntime = vruntime - lag;
|
||||
@@ -6698,6 +6871,12 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags)
|
||||
@@ -6816,6 +7031,14 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags)
|
||||
bool was_sched_idle = sched_idle_rq(rq);
|
||||
|
||||
util_est_dequeue(&rq->cfs, p);
|
||||
+#ifdef CONFIG_SCHED_BORE
|
||||
+ if (task_sleep) {
|
||||
+ update_curr(cfs_rq_of(se));
|
||||
+ cfs_rq = cfs_rq_of(se);
|
||||
+ if (cfs_rq->curr == se)
|
||||
+ update_curr(cfs_rq);
|
||||
+ restart_burst(se);
|
||||
+ }
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
|
||||
for_each_sched_entity(se) {
|
||||
cfs_rq = cfs_rq_of(se);
|
||||
@@ -8429,8 +8608,13 @@ static void yield_task_fair(struct rq *rq)
|
||||
@@ -8565,16 +8788,25 @@ static void yield_task_fair(struct rq *rq)
|
||||
/*
|
||||
* Are we the only task in the tree?
|
||||
*/
|
||||
- if (unlikely(rq->nr_running == 1))
|
||||
+ if (unlikely(rq->nr_running == 1)) {
|
||||
+#ifdef CONFIG_SCHED_BORE
|
||||
+ restart_burst(se);
|
||||
+ update_slice_score(se);
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
+#if !defined(CONFIG_SCHED_BORE)
|
||||
if (unlikely(rq->nr_running == 1))
|
||||
return;
|
||||
+ }
|
||||
|
||||
clear_buddies(cfs_rq, se);
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
|
||||
@@ -8439,6 +8623,10 @@ static void yield_task_fair(struct rq *rq)
|
||||
update_rq_clock(rq);
|
||||
/*
|
||||
* Update run-time statistics of the 'current'.
|
||||
*/
|
||||
update_curr(cfs_rq);
|
||||
+#ifdef CONFIG_SCHED_BORE
|
||||
+ restart_burst(se);
|
||||
+ update_slice_score(se);
|
||||
+ restart_burst_rescale_deadline(se);
|
||||
+ if (unlikely(rq->nr_running == 1))
|
||||
+ return;
|
||||
+
|
||||
+ clear_buddies(cfs_rq, se);
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
/*
|
||||
* Tell update_rq_clock() that we've just updated,
|
||||
* so we don't do microscopic update in schedule()
|
||||
@@ -12664,6 +12896,9 @@ static void task_fork_fair(struct task_struct *p)
|
||||
curr = cfs_rq->curr;
|
||||
if (curr)
|
||||
update_curr(cfs_rq);
|
||||
+#ifdef CONFIG_SCHED_BORE
|
||||
+ update_burst_score(se);
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
place_entity(cfs_rq, se, ENQUEUE_INITIAL);
|
||||
rq_unlock(rq, &rf);
|
||||
}
|
||||
diff --git a/kernel/sched/features.h b/kernel/sched/features.h
|
||||
index f77016823..a2e09c04f 100644
|
||||
index 143f55df8..3f0fe409f 100644
|
||||
--- a/kernel/sched/features.h
|
||||
+++ b/kernel/sched/features.h
|
||||
@@ -6,7 +6,11 @@
|
||||
@ -605,12 +813,37 @@ index f77016823..a2e09c04f 100644
|
||||
SCHED_FEAT(PLACE_DEADLINE_INITIAL, true)
|
||||
+#ifdef CONFIG_SCHED_BORE
|
||||
+SCHED_FEAT(RUN_TO_PARITY, false)
|
||||
+#else // CONFIG_SCHED_BORE
|
||||
+#else // !CONFIG_SCHED_BORE
|
||||
SCHED_FEAT(RUN_TO_PARITY, true)
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
|
||||
/*
|
||||
* Prefer to schedule the task we woke last (assuming it failed
|
||||
--
|
||||
2.43.0.rc2
|
||||
diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h
|
||||
index ed5c758c7..9d62372ae 100644
|
||||
--- a/kernel/sched/sched.h
|
||||
+++ b/kernel/sched/sched.h
|
||||
@@ -1965,7 +1965,11 @@ static inline void dirty_sched_domain_sysctl(int cpu)
|
||||
}
|
||||
#endif
|
||||
|
||||
+#ifdef CONFIG_SCHED_BORE
|
||||
+extern void sched_update_min_base_slice(void);
|
||||
+#else // !CONFIG_SCHED_BORE
|
||||
extern int sched_update_scaling(void);
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
|
||||
static inline const struct cpumask *task_user_cpus(struct task_struct *p)
|
||||
{
|
||||
@@ -2552,6 +2556,9 @@ extern const_debug unsigned int sysctl_sched_nr_migrate;
|
||||
extern const_debug unsigned int sysctl_sched_migration_cost;
|
||||
|
||||
extern unsigned int sysctl_sched_base_slice;
|
||||
+#ifdef CONFIG_SCHED_BORE
|
||||
+extern unsigned int sysctl_sched_min_base_slice;
|
||||
+#endif // CONFIG_SCHED_BORE
|
||||
|
||||
#ifdef CONFIG_SCHED_DEBUG
|
||||
extern int sysctl_resched_latency_warn_ms;
|
||||
--
|
||||
2.43.0.232.ge79552d197
|
||||
|
File diff suppressed because it is too large
Load Diff
3187
patches/cachyos/0002-ntsync.patch
Normal file
3187
patches/cachyos/0002-ntsync.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,21 +1,8 @@
|
||||
From 309712fae7491a876359ddda6e4cf8944f454731 Mon Sep 17 00:00:00 2001
|
||||
From: GloriousEggroll <gloriouseggroll@gmail.com>
|
||||
Date: Wed, 13 Sep 2023 17:59:59 -0600
|
||||
Subject: [PATCH] OpenRGB
|
||||
|
||||
---
|
||||
drivers/i2c/busses/Kconfig | 9 +
|
||||
drivers/i2c/busses/Makefile | 1 +
|
||||
drivers/i2c/busses/i2c-nct6775.c | 647 +++++++++++++++++++++++++++++++
|
||||
drivers/i2c/busses/i2c-piix4.c | 4 +-
|
||||
4 files changed, 659 insertions(+), 2 deletions(-)
|
||||
create mode 100644 drivers/i2c/busses/i2c-nct6775.c
|
||||
|
||||
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
|
||||
index 9cfe8fc50..efc3b0c0b 100644
|
||||
index 2ddca08f8a76..72647850f08e 100644
|
||||
--- a/drivers/i2c/busses/Kconfig
|
||||
+++ b/drivers/i2c/busses/Kconfig
|
||||
@@ -229,6 +229,15 @@ config I2C_CHT_WC
|
||||
@@ -217,6 +217,15 @@ config I2C_CHT_WC
|
||||
combined with a FUSB302 Type-C port-controller as such it is advised
|
||||
to also select CONFIG_TYPEC_FUSB302=m.
|
||||
|
||||
@ -32,10 +19,10 @@ index 9cfe8fc50..efc3b0c0b 100644
|
||||
tristate "Nvidia nForce2, nForce3 and nForce4"
|
||||
depends on PCI
|
||||
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
|
||||
index af56fe2c7..76be74584 100644
|
||||
index 25d60889713c..3c2a9b237ac6 100644
|
||||
--- a/drivers/i2c/busses/Makefile
|
||||
+++ b/drivers/i2c/busses/Makefile
|
||||
@@ -20,6 +20,7 @@ obj-$(CONFIG_I2C_CHT_WC) += i2c-cht-wc.o
|
||||
@@ -17,6 +17,7 @@ obj-$(CONFIG_I2C_CHT_WC) += i2c-cht-wc.o
|
||||
obj-$(CONFIG_I2C_I801) += i2c-i801.o
|
||||
obj-$(CONFIG_I2C_ISCH) += i2c-isch.o
|
||||
obj-$(CONFIG_I2C_ISMT) += i2c-ismt.o
|
||||
@ -45,7 +32,7 @@ index af56fe2c7..76be74584 100644
|
||||
obj-$(CONFIG_I2C_NVIDIA_GPU) += i2c-nvidia-gpu.o
|
||||
diff --git a/drivers/i2c/busses/i2c-nct6775.c b/drivers/i2c/busses/i2c-nct6775.c
|
||||
new file mode 100644
|
||||
index 000000000..0462f0952
|
||||
index 000000000000..0462f0952043
|
||||
--- /dev/null
|
||||
+++ b/drivers/i2c/busses/i2c-nct6775.c
|
||||
@@ -0,0 +1,647 @@
|
||||
@ -697,10 +684,10 @@ index 000000000..0462f0952
|
||||
+module_init(i2c_nct6775_init);
|
||||
+module_exit(i2c_nct6775_exit);
|
||||
diff --git a/drivers/i2c/busses/i2c-piix4.c b/drivers/i2c/busses/i2c-piix4.c
|
||||
index 809fbd014..d54b35b14 100644
|
||||
index 30ded6422e7b..e25ce84c26af 100644
|
||||
--- a/drivers/i2c/busses/i2c-piix4.c
|
||||
+++ b/drivers/i2c/busses/i2c-piix4.c
|
||||
@@ -568,11 +568,11 @@ static int piix4_transaction(struct i2c_adapter *piix4_adapter)
|
||||
@@ -467,11 +467,11 @@ static int piix4_transaction(struct i2c_adapter *piix4_adapter)
|
||||
if (srvrworks_csb5_delay) /* Extra delay for SERVERWORKS_CSB5 */
|
||||
usleep_range(2000, 2100);
|
||||
else
|
||||
@ -714,6 +701,3 @@ index 809fbd014..d54b35b14 100644
|
||||
|
||||
/* If the SMBus is still busy, we give up */
|
||||
if (timeout == MAX_TIMEOUT) {
|
||||
--
|
||||
2.41.0
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,26 +1,11 @@
|
||||
cachyos/0001-cachyos-base-all.patch
|
||||
cachyos/0001-bore-cachy.patch
|
||||
asuslinux/ROG-ALLY-NCT6775-PLATFORM.patch
|
||||
asuslinux/asus-linux.patch
|
||||
asuslinux/rog-ally-audio-fix.patch
|
||||
asuslinux/rog-ally-bmc150.patch
|
||||
asuslinux/v2-0001-platform-x86-asus-wmi-disable-USB0-hub-on-ROG-All.patch
|
||||
cachyos/0002-ntsync.patch
|
||||
nobara/0001-Allow-to-set-custom-USB-pollrate-for-specific-device.patch
|
||||
nobara/0001-Revert-PCI-Add-a-REBAR-size-quirk-for-Sapphire-RX-56.patch
|
||||
nobara/0001-Revert-nvme-pci-drop-redundant-pci_enable_pcie_error.patch
|
||||
nobara/0001-Set-amdgpu.ppfeaturemask-0xffffffff-as-default.patch
|
||||
nobara/0001-acpi-proc-idle-skip-dummy-wait.patch
|
||||
nobara/0001-add-acpi_call.patch
|
||||
nobara/0001-amd-hdr.patch
|
||||
nobara/0001-drm-i915-quirks-disable-async-flipping-on-specific-d.patch
|
||||
nobara/0001-hid-asus-nero-patches-rogue.patch
|
||||
nobara/0002-drm-i915-add-kernel-parameter-to-disable-async-page-.patch
|
||||
nobara/OpenRGB.patch
|
||||
nobara/amdgpu-si-cik-default.patch
|
||||
nobara/lenovo-legion-laptop.patch
|
||||
nobara/linux-surface.patch
|
||||
nobara/mt76:-mt7921:-Disable-powersave-features-by-default.patch
|
||||
nobara/set-ps4-bt-poll-rate-1000hz.patch
|
||||
nobara/steam-deck.patch
|
||||
nobara/uinput.patch
|
||||
nobara/winesync.patc
|
||||
|
@ -2,7 +2,10 @@
|
||||
|
||||
echo "Pika Kernel - Getting source"
|
||||
|
||||
wget -nv https://cdn.kernel.org/pub/linux/kernel/v"$(echo $(cat ./VERSION) | cut -f1 -d".")".x/linux-"$(cat ./VERSION)".tar.gz
|
||||
#wget -nv https://cdn.kernel.org/pub/linux/kernel/v"$(echo $(cat ./VERSION) | cut -f1 -d".")".x/linux-"$(cat ./VERSION)".tar.gz
|
||||
#tar -xf ./linux-"$(cat ./VERSION)".tar.gz
|
||||
|
||||
wget -nv https://git.kernel.org/torvalds/t/linux-6.8-rc6.tar.gz
|
||||
tar -xf ./linux-"$(cat ./VERSION)".tar.gz
|
||||
|
||||
cd linux-"$(cat ./VERSION)"
|
||||
|
Loading…
Reference in New Issue
Block a user