All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next 0/2] Add setup/cleanup for run.sh
@ 2022-12-08 13:08 Zhao Gongyi
  2022-12-08 13:08 ` [PATCH -next 1/2] selftests/intel_pstate: Add saving and restore of scaling_governor Zhao Gongyi
  2022-12-08 13:08 ` [PATCH -next 2/2] selftests/intel_pstate: do cleanup at exit Zhao Gongyi
  0 siblings, 2 replies; 3+ messages in thread
From: Zhao Gongyi @ 2022-12-08 13:08 UTC (permalink / raw
  To: linux-kselftest, linux-kernel, shuah; +Cc: zhaogongyi

1. Add saving and restore of scaling_governor for cpus
2. Remove the tmp files before the test exit

Zhao Gongyi (2):
  selftests/intel_pstate: Add saving and restore of scaling_governor
  selftests/intel_pstate: do cleanup at exit

 tools/testing/selftests/intel_pstate/run.sh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

--
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH -next 1/2] selftests/intel_pstate: Add saving and restore of scaling_governor
  2022-12-08 13:08 [PATCH -next 0/2] Add setup/cleanup for run.sh Zhao Gongyi
@ 2022-12-08 13:08 ` Zhao Gongyi
  2022-12-08 13:08 ` [PATCH -next 2/2] selftests/intel_pstate: do cleanup at exit Zhao Gongyi
  1 sibling, 0 replies; 3+ messages in thread
From: Zhao Gongyi @ 2022-12-08 13:08 UTC (permalink / raw
  To: linux-kselftest, linux-kernel, shuah; +Cc: zhaogongyi

Add saving and restore of scaling_governor for cpus, otherwise the
cpus will run in the policy of powersave, and it would reduce the
performance as unexpected.

Signed-off-by: Zhao Gongyi <zhaogongyi@huawei.com>
---
 tools/testing/selftests/intel_pstate/run.sh | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/tools/testing/selftests/intel_pstate/run.sh b/tools/testing/selftests/intel_pstate/run.sh
index e7008f614ad7..ee78c61cccb9 100755
--- a/tools/testing/selftests/intel_pstate/run.sh
+++ b/tools/testing/selftests/intel_pstate/run.sh
@@ -46,6 +46,12 @@ fi

 max_cpus=$(($(nproc)-1))

+# Save the scaling_governor
+for i in `seq 0 $max_cpus`
+do
+	cat /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor >> /tmp/governor
+done
+
 function run_test () {

 	file_ext=$1
@@ -125,4 +131,14 @@ done
 # print the table
 pr -aTt -5 < /tmp/result.tab

+# restore the scaling_governor
+i=0
+while read line
+do
+	echo $line > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor
+	let i=$i+1
+done < /tmp/governor
+
+rm -f /tmp/governor
+
 exit 0
--
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH -next 2/2] selftests/intel_pstate: do cleanup at exit
  2022-12-08 13:08 [PATCH -next 0/2] Add setup/cleanup for run.sh Zhao Gongyi
  2022-12-08 13:08 ` [PATCH -next 1/2] selftests/intel_pstate: Add saving and restore of scaling_governor Zhao Gongyi
@ 2022-12-08 13:08 ` Zhao Gongyi
  1 sibling, 0 replies; 3+ messages in thread
From: Zhao Gongyi @ 2022-12-08 13:08 UTC (permalink / raw
  To: linux-kselftest, linux-kernel, shuah; +Cc: zhaogongyi

Remove the tmp files before the test exit.

Signed-off-by: Zhao Gongyi <zhaogongyi@huawei.com>
---
 tools/testing/selftests/intel_pstate/run.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/testing/selftests/intel_pstate/run.sh b/tools/testing/selftests/intel_pstate/run.sh
index ee78c61cccb9..3e187e54af16 100755
--- a/tools/testing/selftests/intel_pstate/run.sh
+++ b/tools/testing/selftests/intel_pstate/run.sh
@@ -140,5 +140,6 @@ do
 done < /tmp/governor

 rm -f /tmp/governor
+rm -f /tmp/result\.*

 exit 0
--
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-08 13:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-08 13:08 [PATCH -next 0/2] Add setup/cleanup for run.sh Zhao Gongyi
2022-12-08 13:08 ` [PATCH -next 1/2] selftests/intel_pstate: Add saving and restore of scaling_governor Zhao Gongyi
2022-12-08 13:08 ` [PATCH -next 2/2] selftests/intel_pstate: do cleanup at exit Zhao Gongyi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.