From 9e859f5bf55073a2b4c785b97b9cb78cbdaf127e Mon Sep 17 00:00:00 2001 From: Dominic Hamon Date: Mon, 17 Jan 2022 14:52:02 +0000 Subject: [PATCH] Refine docs on changing cpufreq governor (#1325) Ensure we don't have users accidentally putting their CPUs into powersave. Fixes #1048 --- docs/user_guide.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/user_guide.md b/docs/user_guide.md index 14a4a212..5f3f81ce 100644 --- a/docs/user_guide.md +++ b/docs/user_guide.md @@ -1227,10 +1227,16 @@ If you see this error: ***WARNING*** CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead. ``` -you might want to disable the CPU frequency scaling while running the benchmark: +you might want to disable the CPU frequency scaling while running the benchmark using a script like: ```bash -sudo cpupower frequency-set --governor performance -./mybench -sudo cpupower frequency-set --governor powersave +for f in /sys/devices/system/cpu/cpu?/cpufreq/scaling_governor + do + before=`cat $f` + echo "performance" > $f + ./mybench # run your benchmark here + echo $before > $f +done ``` + +note, you will have to run this as root (under sudo).