Skip to content

Commit

Permalink
Correct the CPUs number for the CPUs offline and online
Browse files Browse the repository at this point in the history
Signed-off-by: qwang59 <[email protected]>
  • Loading branch information
qwang59 authored and ysun committed Sep 6, 2024
1 parent 0ee6842 commit 0f34266
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions BM/cstate/powermgr_cstate_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ verify_single_cpu_freq() {

# Enable all the CPUs idle cstate
for ((i = 0; i < length; i++)); do
for ((j = 0; j < cpus_num; j++)); do
for ((j = 0; j <= cpus_num; j++)); do
do_cmd "echo 0 > grep . /sys/devices/system/cpu/cpu$j/cpuidle/state$i/disable"
done
done
Expand Down Expand Up @@ -851,20 +851,20 @@ turbo_freq_when_idle() {
# If test idle state is POLL/C1/C1E, then disable all the other deeper idle cstate
if [[ "$idle_state" == POLL ]]; then
for ((i = 1; i < length; i++)); do
for ((j = 0; j < cpus_num; j++)); do
for ((j = 0; j <= cpus_num; j++)); do
do_cmd "echo 1 > grep . /sys/devices/system/cpu/cpu$j/cpuidle/state$i/disable"
done
done
elif [[ "$idle_state" == C1 ]]; then
for ((i = 2; i < length; i++)); do
for ((j = 0; j < cpus_num; j++)); do
for ((j = 0; j <= cpus_num; j++)); do
do_cmd "echo 1 > grep . /sys/devices/system/cpu/cpu$j/cpuidle/state$i/disable"
done
done
elif [[ "$idle_state" == C1E ]]; then
if grep -q 'C1E' /sys/devices/system/cpu/cpu0/cpuidle/state*/name; then
for ((i = 3; i < length; i++)); do
for ((j = 0; j < cpus_num; j++)); do
for ((j = 0; j <= cpus_num; j++)); do
do_cmd "echo 1 > grep . /sys/devices/system/cpu/cpu$j/cpuidle/state$i/disable"
done
done
Expand Down

0 comments on commit 0f34266

Please sign in to comment.