From faa645b8250d33206258bf94e5ab271f6e3d90ba Mon Sep 17 00:00:00 2001 From: Solene Rapenne Date: Mon, 21 Mar 2022 13:22:01 +0100 Subject: [PATCH] obsdfreqd: new -T flag for temperature --- README.md | 5 ++++- obsdfreqd.1 | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7d21bd5..8d18849 100644 --- a/README.md +++ b/README.md @@ -32,10 +32,11 @@ Parameters are applied when both plugged on the wall or on battery, parameters c - `-r threshold` sets the CPU usage in % that will trigger the frequency increase, 30% is the default - `-s stepfrequency` sets the percent of frequency added every cycle when increasing, 10% is default - `-t timefreq` sets the milliseconds between each poll, 300 is the default +- `-T maxtemperature` sets the temperature threshold under which the maximum frequency will be temporary lowered until the CPU cools down **Example**: -`obsdfreqd -m 100,50 -r 40` will start the daemon, when power is plugged in, maximum frequency is 100 and threshold is 40, on battery the threshold is 40 and the max is 50. +`obsdfreqd -T 90,65` will start the daemon, when power is plugged in, maximum temperature is set to 90°C and 65°C when on battery. # Explanation @@ -45,6 +46,8 @@ If CPU usage > `threshold`, increase frequency by `stepfrequency` up to `maxfreq If CPU usage <= `threshold`, reduce frequency by `downstepfrequency` down to `minfrequency` every `timefreq` milliseconds when `inertia` reached 0. `inertia` lose one point every cycle the CPU usage is below `threshold`. +When flag `-T` is used, if the temperature exceeds the defined limit, the `maxfrequency` is decremented every cycle. When the current temperature is below the limit, the frequency limit is incremented at every cycle. + When switching from/to battery, values switch to mode specific when user defined. # What is it doing? diff --git a/obsdfreqd.1 b/obsdfreqd.1 index 87fe596..a1ee138 100644 --- a/obsdfreqd.1 +++ b/obsdfreqd.1 @@ -15,6 +15,7 @@ .Op Fl r Ar threshold .Op Fl s Ar stepfrequency .Op Fl t Ar timefreq +.Op Fl T Ar maxtemperature .Sh DESCRIPTION .Pp .Nm @@ -46,6 +47,11 @@ Defines the CPU usage in percent above which the frequency is increased. Defines the frequency increase step in percent. .It Op Fl t Ar timefreq Defines the time in milliseconds between each cycle. +.It Op Fl T Ar maxtemperature +Defines the maximum temperature in Celcius +.Nm +will allow before lowering the maximum frequency until it the temperature +cooled down. .Ed .Sh EXIT STATUS .Pp