From 3eaa854b886dcac507faf3ed113cdcff2e8e5f49 Mon Sep 17 00:00:00 2001 From: Dietmar Eggemann Date: Mon, 27 Nov 2023 22:45:02 +0100 Subject: [PATCH] lisa._assets.kmodules.lisa: Don't rely on rq->cpu_capacity_orig anymore The kernel commit 7bc263840bc3 ("sched/topology: Consolidate and clean up access to a CPU's max compute") removed rq->cpu_capacity_orig so we can't use it anymore to retrieve the original CPU capacity nor for setting the FREQ_INVARIANCE kernel feature in LISA. Replace rq->cpu_capacity_orig with arch_scale_cpu_capacity(cpu) in Lisa trace module's rq_cpu_orig_capacity() and remove the HAS_MEMBER(struct, rq, cpu_capacity_orig) check from the FREQ_INVARIANCE test. Since arch_scale_cpu_capacity(cpu) exists in the kernel for a long time we don't have to take care of activating this only for newer Linux kernel versions. Signed-off-by: Dietmar Eggemann --- lisa/_assets/kmodules/lisa/introspection.json | 2 +- lisa/_assets/kmodules/lisa/sched_helpers.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lisa/_assets/kmodules/lisa/introspection.json b/lisa/_assets/kmodules/lisa/introspection.json index 1955511b5d..a7d9cf2acc 100644 --- a/lisa/_assets/kmodules/lisa/introspection.json +++ b/lisa/_assets/kmodules/lisa/introspection.json @@ -29,6 +29,6 @@ "SCHED_AVG_RBL": "HAS_MEMBER(struct, sched_avg, runnable_load_avg) || HAS_MEMBER(struct, sched_avg, runnable_avg)", "FILE_IO": "HAS_SYMBOL(kernel_read) && HAS_SYMBOL(kernel_write) && HAS_SYMBOL(filp_open)", - "FREQ_INVARIANCE": "HAS_SYMBOL(arch_freq_scale) && HAS_MEMBER(struct, rq, cpu_capacity_orig)" + "FREQ_INVARIANCE": "HAS_SYMBOL(arch_freq_scale)" } } diff --git a/lisa/_assets/kmodules/lisa/sched_helpers.h b/lisa/_assets/kmodules/lisa/sched_helpers.h index 2e4cb771e9..80aa3ed119 100644 --- a/lisa/_assets/kmodules/lisa/sched_helpers.h +++ b/lisa/_assets/kmodules/lisa/sched_helpers.h @@ -218,7 +218,7 @@ static inline int rq_cpu_orig_capacity(const struct rq *rq) { return # if HAS_KERNEL_FEATURE(FREQ_INVARIANCE) - rq->cpu_capacity_orig; + arch_scale_cpu_capacity(cpu_of(rq)) # else rq_cpu_capacity(rq) # endif