set_powersave performance enhancement (#28)

now set_powersave only turns on turbo boost when all 1m load avg is higher than all available cores instead of 4 cores, this should work better for a broader range of cpus.
This commit is contained in:
e4BdSBmUzHowFico5Ktn 2020-01-12 07:04:24 +00:00 committed by Adnan Hodzic
parent 5734162a7d
commit e2f6da6072

View File

@ -22,6 +22,7 @@ p = psutil
pl = platform pl = platform
s = subprocess s = subprocess
tool_run = sys.argv[0] tool_run = sys.argv[0]
cpus = os.cpu_count()
# get turbo boost state # get turbo boost state
cur_turbo = s.getoutput("cat /sys/devices/system/cpu/intel_pstate/no_turbo") cur_turbo = s.getoutput("cat /sys/devices/system/cpu/intel_pstate/no_turbo")
@ -147,7 +148,7 @@ def set_powersave():
print("Total system load:", load1m, "\n") print("Total system load:", load1m, "\n")
# conditions for setting turbo in powersave # conditions for setting turbo in powersave
if load1m > 4: if load1m > cpus:
print("High load, setting turbo boost: on") print("High load, setting turbo boost: on")
s.run("echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo", shell=True) s.run("echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo", shell=True)
footer(79) footer(79)