Browse Source

Set CPU governor properly on linux benchmarks

cpu* was used to select all CPUs, but this incorrectly selects 
folders such as cpufreq and cpuidle, which you cannot set a 
governor on. Therefore this call not only always failed, but 
actually stopped the other tuning calls from running. The 
proper wildcard should only select folders named 
cpu[number], so I've used cpu[0-9]. This may silently fail if
someone has more than 10 CPUs e.g. cpu14, perhaps there's a 
bash wildcard option to allow [0-9]*?
Hamilton Turner 11 years ago
parent
commit
8365792b0c
1 changed files with 1 additions and 2 deletions
  1. 1 2
      toolset/benchmark/benchmarker.py

+ 1 - 2
toolset/benchmark/benchmarker.py

@@ -402,8 +402,7 @@ class Benchmarker:
     try:
       if os.name == 'nt':
         return True
-      # This doesn't seem to ever run correctly, which causes the rest to not be run.
-      #subprocess.check_call(["sudo","bash","-c","cd /sys/devices/system/cpu; ls -d cpu*|while read x; do echo performance > $x/cpufreq/scaling_governor; done"])
+      subprocess.check_call(["sudo","bash","-c","cd /sys/devices/system/cpu; ls -d cpu[0-9]|while read x; do echo performance > $x/cpufreq/scaling_governor; done"])
       subprocess.check_call("sudo sysctl -w net.ipv4.tcp_max_syn_backlog=65535".rsplit(" "))
       subprocess.check_call("sudo sysctl -w net.core.somaxconn=65535".rsplit(" "))
       subprocess.check_call("sudo -s ulimit -n 65535".rsplit(" "))