Skip to content

Commit

Permalink
intel pstate handle
Browse files Browse the repository at this point in the history
  • Loading branch information
sulincix committed Jul 8, 2024
1 parent 0bb57ce commit c254a37
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/service/backends/power.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ def _powersave():
# platform profile
writefile("/sys/firmware/acpi/platform_profile","low-power")

# intel pstate
freq_path="/sys/devices/system/cpu/cpufreq/"
for dir in listdir(freq_path):
if dir.startswith("policy"):
epath="energy_performance_preferences"
writefile("{}/{}/{}".format(freq_path, dir, epath), "power")

# less disk activity
writefile("/proc/sys/vm/dirty_writeback_centisecs",1500)
writefile("/proc/sys/vm/dirty_expire_centisecs",3000)
Expand Down Expand Up @@ -211,6 +218,14 @@ def _performance():
# platform profile
writefile("/sys/firmware/acpi/platform_profile","performance")

# intel pstate
freq_path="/sys/devices/system/cpu/cpufreq/"
for dir in listdir(freq_path):
if dir.startswith("policy"):
epath="energy_performance_preferences"
writefile("{}/{}/{}".format(freq_path, dir, epath), "performance")


# more disk activity
writefile("/proc/sys/vm/dirty_writeback_centisecs",500)
writefile("/proc/sys/vm/dirty_expire_centisecs",500)
Expand Down

0 comments on commit c254a37

Please sign in to comment.