mirror of
https://github.com/AdnanHodzic/auto-cpufreq.git
synced 2025-07-23 21:55:09 +02:00
Modified fixed cpu usage percentage (#99)
* A fixed value of 25% CPU Load is not correct for enabling turbo, it should be enabled when one thread reach 100% * A fixed turbo on chargin state * Improved 1 thread CPU 100% load detection solution Co-authored-by: Roberto Rodríguez <rrodriguez@datiobd.com>
This commit is contained in:
parent
5a169a1357
commit
c4d7f43803
@ -9,6 +9,7 @@ import shutil
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import warnings
|
import warnings
|
||||||
|
from math import isclose
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from pprint import pformat
|
from pprint import pformat
|
||||||
from subprocess import getoutput, call, run
|
from subprocess import getoutput, call, run
|
||||||
@ -303,7 +304,7 @@ def set_powersave():
|
|||||||
if load1m > CPUS / 7:
|
if load1m > CPUS / 7:
|
||||||
print("High load, setting turbo boost: on")
|
print("High load, setting turbo boost: on")
|
||||||
turbo(True)
|
turbo(True)
|
||||||
elif cpuload > 25:
|
elif psutil.cpu_percent(percpu=False) >= 25.0 or isclose(max(psutil.cpu_percent(percpu=True)), 100):
|
||||||
print("High CPU load, setting turbo boost: on")
|
print("High CPU load, setting turbo boost: on")
|
||||||
turbo(True)
|
turbo(True)
|
||||||
else:
|
else:
|
||||||
@ -331,7 +332,7 @@ def mon_powersave():
|
|||||||
print("Currently turbo boost is: off")
|
print("Currently turbo boost is: off")
|
||||||
footer()
|
footer()
|
||||||
|
|
||||||
elif cpuload > 25:
|
elif psutil.cpu_percent(percpu=False) >= 25.0 or isclose(max(psutil.cpu_percent(percpu=True)), 100):
|
||||||
print("High CPU load, suggesting to set turbo boost: on")
|
print("High CPU load, suggesting to set turbo boost: on")
|
||||||
if turbo():
|
if turbo():
|
||||||
print("Currently turbo boost is: on")
|
print("Currently turbo boost is: on")
|
||||||
@ -364,7 +365,7 @@ def set_performance():
|
|||||||
if load1m >= CPUS / 5:
|
if load1m >= CPUS / 5:
|
||||||
print("High load, setting turbo boost: on")
|
print("High load, setting turbo boost: on")
|
||||||
turbo(True)
|
turbo(True)
|
||||||
elif cpuload > 20:
|
elif psutil.cpu_percent(percpu=False) >= 15.0 or isclose(max(psutil.cpu_percent(percpu=True)), 100):
|
||||||
print("High CPU load, setting turbo boost: on")
|
print("High CPU load, setting turbo boost: on")
|
||||||
turbo(True)
|
turbo(True)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user