Skip to content

Commit

Permalink
lisa._assets.kmodules.lisa: Don't rely on rq->cpu_capacity_orig anymore
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
deggeman committed Nov 28, 2023
1 parent 627de71 commit 3eaa854
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lisa/_assets/kmodules/lisa/introspection.json
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
}
}
2 changes: 1 addition & 1 deletion lisa/_assets/kmodules/lisa/sched_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3eaa854

Please sign in to comment.