From f9a6658fea6805ed19c7a1609315782f0e6f9dd2afa2ace10e66161b33dfd857 Mon Sep 17 00:00:00 2001 From: Late Night Defender Date: Mon, 25 Nov 2024 01:54:39 +0700 Subject: [PATCH] Add CPU Boost controller systemd services --- limit-cpu-power.service | 12 ++++++++++++ no-turbo.service | 11 +++++++++++ 2 files changed, 23 insertions(+) create mode 100644 limit-cpu-power.service create mode 100644 no-turbo.service diff --git a/limit-cpu-power.service b/limit-cpu-power.service new file mode 100644 index 0000000..ae77484 --- /dev/null +++ b/limit-cpu-power.service @@ -0,0 +1,12 @@ +[Unit] +Description=Limit CPU power on startup + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=sh -c 'echo 90 | sudo tee /sys/devices/system/cpu/intel_pstate/max_perf_pct' +ExecStop=sh -c 'echo 100 | sudo tee /sys/devices/system/cpu/intel_pstate/max_perf_pct' + + +[Install] +WantedBy=multi-user.target default.target diff --git a/no-turbo.service b/no-turbo.service new file mode 100644 index 0000000..86b3654 --- /dev/null +++ b/no-turbo.service @@ -0,0 +1,11 @@ +[Unit] +Description=Disable Turbo Boost on startup + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=sh -c 'echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo' +ExecStop=sh -c 'echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo' + +[Install] +WantedBy=multi-user.target default.target