Skip to contentSkip to conversation

cpufreq.c: add new test for cpufreq sysfs interface validation

PATCH Superseded Piotr Kubaj 2 participants 2 messages May 6

v6 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

PATCH v6 1/1 cpufreq.c: add new test for cpufreq sysfs interface validation

Runs various sanity checks for intel_pstate cpufreq sysfs interface.

Checks whether intel_pstate driver is used, whether it is possible to switch scaling_governor to powersave and performance, whether it is possible to disable turbo frequency and whether it is possible to change scaling_min_freq and scaling_max_freq to its minimal valid and maximal valid values.

---
Address review:
1. add comment for why root is needed.
2. check that intel_pstate/{no_turbo,status} are present.

 runtest/power_management_tests               |   1 +
 testcases/kernel/power_management/.gitignore |   1 +
 testcases/kernel/power_management/cpufreq.c  | 403 +++++++++++++++++++
 3 files changed, 405 insertions(+)
 create mode 100644 testcases/kernel/power_management/.gitignore
 create mode 100644 testcases/kernel/power_management/cpufreq.c
runtest/power_management_tests +1 -0
index b670da6ec..0bc7dd0c8 100644
@@ -1,4 +1,5 @@
 #POWER_MANAGEMENT
+cpufreq cpufreq
 runpwtests03 runpwtests03.sh
 runpwtests04 runpwtests04.sh
 runpwtests06 runpwtests06.sh
testcases/kernel/power_management/.gitignore new file +1 -0
new file mode 100644
index 000000000..7f34e4c2f
@@ -0,0 +1 @@
+cpufreq
testcases/kernel/power_management/cpufreq.c new file +403 -0

403 lines not on this page · raw message

Signature · 13 lines
2.47.3

---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
#1 lore raw

Hi Piotr,

testcases/kernel/power_management/cpufreq.c line 331

Quoted 12 lines · Piotr Kubaj

cpufreq.c: add new test for cpufreq sysfs interface validation

testcases/kernel/power_management/cpufreq.c new file +10 -0
+	tst_res(TDEBUG, "Checking whether scaling_available_governors contains \"performance\" and \"schedutil\" after switching /sys/devices/system/cpu/intel_pstate/status to \"passive\"");
+	snprintf(path, sizeof(path), "/sys/devices/system/cpu/intel_pstate/status");
+	SAFE_FILE_PRINTF(path, "passive");
+
+	for (int i = 0; i < nproc; i++) {
+		...
+		SAFE_FILE_PRINTF(path, "schedutil");
+		...
+	}
+}

run() exits with intel_pstate/status still "passive" and each CPU's scaling_governor still "schedutil". On the second iteration (-i 2) the status check fires TFAIL immediately, and the governor branch hits tst_brk(TBROK, "Unknown scaling_governor: schedutil").

Restore the status to "active" and the governors to previous_scaling_governor[i] at the end of run() before it returns.

[...]

---
Note:

Our agent completed the review of the patch. The full review can be found at: https://patchwork.ozlabs.org/project/ltp/list/?series=502943

The agent can sometimes produce false positives although often its findings are genuine. If you find issues with the review, please comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp