Skip to content

Commit

Permalink
Fix PRJC for 6.0
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Jung <[email protected]>
  • Loading branch information
ptr1337 committed Dec 9, 2022
1 parent c913d4d commit 89f9449
Showing 1 changed file with 178 additions and 2 deletions.
180 changes: 178 additions & 2 deletions 6.0/sched/0001-prjc-cachy.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 8cc221774826a82c339e7de5e6dcfde138592818 Mon Sep 17 00:00:00 2001
From: Peter Jung <[email protected]>
Date: Fri, 9 Dec 2022 14:02:38 +0100
Subject: [PATCH 1/2] prjc-cachy
Subject: [PATCH 1/4] prjc-cachy

Signed-off-by: Peter Jung <[email protected]>
---
Expand Down Expand Up @@ -10208,7 +10208,7 @@ index a2d301f58ced..2ccdede8585c 100644
From b7704e21a6d69812ace9fd773c3c2280403d5146 Mon Sep 17 00:00:00 2001
From: Peter Jung <[email protected]>
Date: Fri, 9 Dec 2022 14:03:23 +0100
Subject: [PATCH 2/2] Revert "sched/pelt: Change PELT halflife at runtime"
Subject: [PATCH 2/4] Revert "sched/pelt: Change PELT halflife at runtime"

This reverts commit 10ef3eea2ff94093f26ea6217326d60537a4d797.

Expand Down Expand Up @@ -10402,3 +10402,179 @@ index 6a1cf35c8eca..fd0b8c50eccd 100644
--
2.39.0.rc2

From 9cd05db97d2275213a521558f38c0727187b5375 Mon Sep 17 00:00:00 2001
From: Peter Jung <[email protected]>
Date: Fri, 9 Dec 2022 14:13:52 +0100
Subject: [PATCH 3/4] Revert "add scheduler turbo3 patch"

This reverts commit 5c15e02587316cef9d6b311646dfc30d3c3bb181.
---
arch/x86/kernel/itmt.c | 14 --------------
kernel/sched/fair.c | 19 -------------------
2 files changed, 33 deletions(-)

diff --git a/arch/x86/kernel/itmt.c b/arch/x86/kernel/itmt.c
index 596fd7fb7847..d4326e050fb7 100644
--- a/arch/x86/kernel/itmt.c
+++ b/arch/x86/kernel/itmt.c
@@ -178,11 +178,6 @@ int arch_asym_cpu_priority(int cpu)
return per_cpu(sched_core_priority, cpu) * power_ratio / 256;
}

-extern int best_core;
-extern int second_best_core;
-static int best_core_score;
-static int second_best_core_score;
-
/**
* sched_set_itmt_core_prio() - Set CPU priority based on ITMT
* @prio: Priority of cpu core
@@ -212,15 +207,6 @@ void sched_set_itmt_core_prio(int prio, int core_cpu)
smt_prio = prio * smp_num_siblings / (i * i);
per_cpu(sched_core_priority, cpu) = smt_prio;
i++;
-
- if (smt_prio > best_core_score) {
- best_core = cpu;
- best_core_score = smt_prio;
- } else
- if (smt_prio > second_best_core_score) {
- second_best_core = cpu;
- second_best_core_score = smt_prio;
- }
}
}

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index e25a1e31ebb3..f7899278e979 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7039,10 +7039,6 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu)
*
* Returns the target CPU number.
*/
-
-int best_core = -1;
-int second_best_core = -1;
-
static int
select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags)
{
@@ -7071,21 +7067,6 @@ select_task_rq_fair(struct task_struct *p, int prev_cpu, int wake_flags)
want_affine = !wake_wide(p) && cpumask_test_cpu(cpu, p->cpus_ptr);
}

- if (prev_cpu != best_core && prev_cpu != second_best_core &&
- cpu_rq(prev_cpu)->nr_running != 0) {
- if (second_best_core != -1 && cpu_rq(second_best_core)->nr_running == 0 &&
- nr_iowait_cpu(second_best_core) < 2 && cpu_to_node(prev_cpu) == cpu_to_node(second_best_core))
- prev_cpu = second_best_core;
- if (best_core != -1 && cpu_rq(best_core)->nr_running == 0 &&
- nr_iowait_cpu(best_core) < 2 && cpu_to_node(prev_cpu) == cpu_to_node(best_core))
- prev_cpu = best_core;
- }
-/*
- if (prev_cpu > 0 && cpu_rq(prev_cpu)->nr_running != 0 && cpu_rq(prev_cpu - 1)->nr_running == 0)
- prev_cpu = prev_cpu - 1;
-*/
-
-
rcu_read_lock();
for_each_domain(cpu, tmp) {
/*
--
2.39.0.rc2

From 1fc9e79973fd8c9f7a75879e183c323ed8fc59bc Mon Sep 17 00:00:00 2001
From: Peter Jung <[email protected]>
Date: Fri, 9 Dec 2022 14:14:22 +0100
Subject: [PATCH 4/4] Revert "itmt_epb: use epb to scale itmt"

This reverts commit 40953f9614bc7b76b82b52b27eceeb65a0fcdb19.
---
arch/x86/include/asm/topology.h | 1 -
arch/x86/kernel/cpu/intel_epb.c | 4 ----
arch/x86/kernel/itmt.c | 29 +----------------------------
3 files changed, 1 insertion(+), 33 deletions(-)

diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
index d86eb1ebf59f..458c891a8273 100644
--- a/arch/x86/include/asm/topology.h
+++ b/arch/x86/include/asm/topology.h
@@ -175,7 +175,6 @@ extern unsigned int __read_mostly sysctl_sched_itmt_enabled;

/* Interface to set priority of a cpu */
void sched_set_itmt_core_prio(int prio, int core_cpu);
-void sched_set_itmt_power_ratio(int power_ratio, int core_cpu);

/* Interface to notify scheduler that system supports ITMT */
int sched_set_itmt_support(void);
diff --git a/arch/x86/kernel/cpu/intel_epb.c b/arch/x86/kernel/cpu/intel_epb.c
index c8c2d6f1a8ac..fbaf12e43f41 100644
--- a/arch/x86/kernel/cpu/intel_epb.c
+++ b/arch/x86/kernel/cpu/intel_epb.c
@@ -166,10 +166,6 @@ static ssize_t energy_perf_bias_store(struct device *dev,
if (ret < 0)
return ret;

- /* update the ITMT scheduler logic to use the power policy data */
- /* scale the val up by 2 so the range is 224 - 256 */
- sched_set_itmt_power_ratio(256 - val * 2, cpu);
-
return count;
}

diff --git a/arch/x86/kernel/itmt.c b/arch/x86/kernel/itmt.c
index d4326e050fb7..9ff480e94511 100644
--- a/arch/x86/kernel/itmt.c
+++ b/arch/x86/kernel/itmt.c
@@ -25,7 +25,6 @@

static DEFINE_MUTEX(itmt_update_mutex);
DEFINE_PER_CPU_READ_MOSTLY(int, sched_core_priority);
-DEFINE_PER_CPU_READ_MOSTLY(int, sched_power_ratio);

/* Boolean to track if system has ITMT capabilities */
static bool __read_mostly sched_itmt_capable;
@@ -170,12 +169,7 @@ void sched_clear_itmt_support(void)

int arch_asym_cpu_priority(int cpu)
{
- int power_ratio = per_cpu(sched_power_ratio, cpu);
-
- /* a power ratio of 0 (uninitialized) is assumed to be maximum */
- if (power_ratio == 0)
- power_ratio = 256 - 2 * 6;
- return per_cpu(sched_core_priority, cpu) * power_ratio / 256;
+ return per_cpu(sched_core_priority, cpu);
}

/**
@@ -209,24 +203,3 @@ void sched_set_itmt_core_prio(int prio, int core_cpu)
i++;
}
}
-
-/**
- * sched_set_itmt_power_ratio() - Set CPU priority based on ITMT
- * @power_ratio: The power scaling ratio [1..256] for the core
- * @core_cpu: The cpu number associated with the core
- *
- * Set a scaling to the cpu performance based on long term power
- * settings (like EPB).
- *
- * Note this is for the policy not for the actual dynamic frequency;
- * the frequency will increase itself as workloads run on a core.
- */
-
-void sched_set_itmt_power_ratio(int power_ratio, int core_cpu)
-{
- int cpu;
-
- for_each_cpu(cpu, topology_sibling_cpumask(core_cpu)) {
- per_cpu(sched_power_ratio, cpu) = power_ratio;
- }
-}
--
2.39.0.rc2

0 comments on commit 89f9449

Please sign in to comment.