ARM-software / lisa

Linux Integrated System Analysis
Apache License 2.0
203 stars 119 forks source link

lisa._assets.kmodules.lisa: Don't rely on rq->cpu_capacity_orig anymore #2145

Closed deggeman closed 10 months ago

deggeman commented 11 months ago

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.

deggeman commented 11 months ago

Related to PWRSOFT-5115

deggeman commented 11 months ago

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.

Pull request: https://github.com/ARM-software/lisa/pull/2145

credp commented 11 months ago

We probably need to figure out how to make this work for pre and post-patch kernels in order to complete this.

deggeman commented 11 months ago

Fortunately not in this case:

I use arch_scale_cpu_capacity(cpu) now instead as accessing rq->cpu_capacity_orig directly.

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.

deggeman commented 10 months ago

I updated the fix by implementing choice 1.