Skip to content

Commit

Permalink
Add tuned.service check for the CPU frequency limitation cases
Browse files Browse the repository at this point in the history
Signed-off-by: qwang59 <[email protected]>
  • Loading branch information
qwang59 committed Jul 24, 2024
1 parent 15ea123 commit 2b1fd82
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
13 changes: 13 additions & 0 deletions BM/cstate/powermgr_cstate_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ do_kill_pid() {
[[ -n "$upid" ]] && do_cmd "kill -9 $upid"
}

# Function to check tuned.service is enabled or disabled
# This may impact the cpu frequency when a workload is running
check_tuned_service() {
# Check the status of tuned.service using systemctl
if systemctl is-enabled --quiet tuned.service; then
test_print_trc "tuned.service is enabled, which may change the performance profile and impact the CPU frequency,\
please consider disabling it with the command: 'sudo systemctl disable tuned.service', then reboot the system."
else
test_print_trc "tuned.service is disabled, so it will not impact the CPU frequency."
fi
}

# Function to verify if Intel_idle driver refer to BIOS _CST table
test_cstate_table_name() {
local cstate_name=""
Expand Down Expand Up @@ -787,6 +799,7 @@ verify_single_cpu_freq() {
test_print_trc "$current_freq is lower than $max_freq with power limitation assert"
else
test_print_trc "The package and core power limitation is NOT assert."
check_tuned_service
die "$current_freq is lower than $max_freq without power limitation assert"
fi
else
Expand Down
15 changes: 15 additions & 0 deletions BM/isst/intel_sst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@ isst_legacy_driver_interface() {
done
}

# Function to check tuned.service is enabled or disabled
# This may impact the cpu frequency when a workload is running
check_tuned_service() {
# Check the status of tuned.service using systemctl
if systemctl is-enabled --quiet tuned.service; then
test_print_trc "tuned.service is enabled, which may change the performance profile and impact the CPU frequency,\
please consider disabling it with the command: 'sudo systemctl disable tuned.service', then reboot the system."
else
test_print_trc "tuned.service is disabled, so it will not impact the CPU frequency."
fi
}

power_limit_check() {
pkg_power_limitation_log=$(rdmsr -p 1 0x1b1 -f 11:11 2>/dev/null)
test_print_trc "The power limitation log from package thermal status 0x1b1 bit 11 is: \
Expand Down Expand Up @@ -612,6 +624,7 @@ isst_bf_baseline_test() {
with power limitation log observed."
else
test_print_trc "The package and core power limitation is not assert."
check_tuned_service
die "The CPUs base freq is 100Mhz larger than expected base_freq without power limitation assert."
fi
else
Expand Down Expand Up @@ -740,6 +753,7 @@ isst_bf_freq_test() {
test_print_trc "The 2nd and 3rd CPUs of package$j did not reach ISST HP base freq when power limitation assert."
else
test_print_trc "The package$j and core power limitation is not assert."
check_tuned_service
die "The 2nd and 3rd CPUs of package$j did not reach ISST HP base freq without power limitation assert."
fi
else
Expand Down Expand Up @@ -860,6 +874,7 @@ isst_tf_freq_test() {
die "The test CPUs did not reach ISST HP turbo freq when power limitation assert."
else
test_print_trc "The package and core power limitation is not assert."
check_tuned_service
die "The test CPUs did not reach ISST HP turbo freq without power limitation assert."
fi
else
Expand Down
13 changes: 13 additions & 0 deletions BM/pstate/intel_pstate_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,18 @@ cpufreq_sysfs_attr() {
fi
}

# Function to check tuned.service is enabled or disabled
# This may impact the cpu frequency when a workload is running
check_tuned_service() {
# Check the status of tuned.service using systemctl
if systemctl is-enabled --quiet tuned.service; then
test_print_trc "tuned.service is enabled, which may change the performance profile and impact the CPU frequency,\
please consider disabling it with the command: 'sudo systemctl disable tuned.service', then reboot the system."
else
test_print_trc "tuned.service is disabled, so it will not impact the CPU frequency."
fi
}

# Function to check if there is any package and core power limitation being asserted
# When CPU Frequency is lower than the expected value.
power_limit_check() {
Expand Down Expand Up @@ -350,6 +362,7 @@ check_max_cores_freq() {
test_print_trc "$current_freq is lower than $max_freq with power limitation asserted"
else
test_print_trc "The package and core power limitation is NOT being asserted."
check_tuned_service
die "$current_freq is lower than $max_freq without power limitation asserted"
fi
else
Expand Down

0 comments on commit 2b1fd82

Please sign in to comment.