View previous topic :: View next topic |
Author |
Message |
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3810 Location: Rasi, Finland
|
Posted: Thu Aug 15, 2024 5:45 pm Post subject: |
|
|
Ok. That was what I've been using, so that's good.
However I get crashes. I'll start the daemon on foreground to see if it tells something upon crashing... _________________ ..: Zucca :..
My gentoo installs: | init=/sbin/openrc-init
-systemd -logind -elogind seatd |
Quote: | I am NaN! I am a man! |
|
|
Back to top |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2542
|
Posted: Thu Aug 15, 2024 6:45 pm Post subject: |
|
|
pa4wdh wrote: | logrusx wrote: | Today my computer started stuttering and I noticed the following:
Code: | ^C2024-08-15 10:05:58: Received signal 2, exiting.
2024-08-15 10:05:58: Set scaling frequency to CPU's minimum frequency
|
Why'd you do that? Then I have to manually adjust the scaling frequency.
|
My personal goal with this program was my passively cooled desktop, which means that it can overheat when the daemon is not running. As a safety measure it sets the CPU frequency to it's minimum when it exits (either a normal exit or due to an error). I could make that behavior optional if that makes more sense.
Thanks for updating you overlay Zucca. |
It looks like unexpected side effect. A daemon is supposed to have effect only when it's running. And it even contains the effect in its name. No problem, I can kill it instead of terminate it, but I don't need it running all the time, nor I need it to render my computer sluggish on exit.
Best Regards,
Georgi
Last edited by logrusx on Fri Aug 16, 2024 4:49 am; edited 1 time in total |
|
Back to top |
|
|
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3810 Location: Rasi, Finland
|
Posted: Thu Aug 15, 2024 7:55 pm Post subject: |
|
|
tail of the log: | Aug 15 21:01:01 [cputemp2maxfreq] Minimum frequency: 1400000
Aug 15 21:01:01 [cputemp2maxfreq] Maximum frequency: 2100000
Aug 15 21:01:01 [cputemp2maxfreq] Scaling maximum frequency: 1400000
Aug 15 21:01:01 [cputemp2maxfreq] Transition Latency: 100000 (Set via commandline)
Aug 15 21:01:01 [cputemp2maxfreq] Increase scaling_max_freq to 2100000
Aug 15 21:09:52 [cputemp2maxfreq] Decrease scaling_max_freq to 2000000
Aug 15 21:09:52 [cputemp2maxfreq] Failed to set scaling_max_freq, exiting
Aug 15 21:09:52 [cputemp2maxfreq] Set scaling frequency to CPU's minimum frequency |
Code: | NBLK-WAX9X ~ # cpupower frequency-info | fgrep avail
available frequency steps: 2.10 GHz, 1.70 GHz, 1.40 GHz
available cpufreq governors: conservative ondemand userspace powersave performance schedutil |
Ah. My CPU only supports three frequency states. And the jumps are 400Mhz and 300Mhz.
I guess if I set the step to 700Mhz I should not get crashes. _________________ ..: Zucca :..
My gentoo installs: | init=/sbin/openrc-init
-systemd -logind -elogind seatd |
Quote: | I am NaN! I am a man! |
|
|
Back to top |
|
|
pa4wdh l33t
Joined: 16 Dec 2005 Posts: 892
|
Posted: Fri Aug 16, 2024 3:10 pm Post subject: |
|
|
Zucca wrote: | I vote for:
Change governor to powersave and adjust frequency to minimum, unless configured otherwise. |
Changing the governor shouldn't make any difference if the frequency is set to minimum, unless the governor ignores that value, which it shouldn't.
logrusx wrote: | It looks like unexpected side effect |
No, it's completely intended and expected. My use-case is to have it running all the time, if it exists for whatever reason if should take safety measures.
Zucca wrote: | Ah. My CPU only supports three frequency states. And the jumps are 400Mhz and 300Mhz.
I guess if I set the step to 700Mhz I should not get crashes. |
My program is intended to be used on CPU's that allow any frequency to be set (with a range of course), so i expect it to stop anytime when the jump the processor can make is different from the step size. _________________ The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world
My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com |
|
Back to top |
|
|
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3810 Location: Rasi, Finland
|
Posted: Fri Aug 16, 2024 5:37 pm Post subject: |
|
|
pa4wdh wrote: | Zucca wrote: | Ah. My CPU only supports three frequency states. And the jumps are 400Mhz and 300Mhz.
I guess if I set the step to 700Mhz I should not get crashes. |
My program is intended to be used on CPU's that allow any frequency to be set (with a range of course), so i expect it to stop anytime when the jump the processor can make is different from the step size. | I set it now to jump from 2.1GHz to 1.4GHz when the temperature reaches the limit. It works fine for my use-case now. ;)
Basically now governor scales the frequency however it likes. If the temperature is too high, the cpu is set to run at minimum frequency. And my laptop stays quiet. Yay! _________________ ..: Zucca :..
My gentoo installs: | init=/sbin/openrc-init
-systemd -logind -elogind seatd |
Quote: | I am NaN! I am a man! |
|
|
Back to top |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2542
|
Posted: Fri Aug 16, 2024 6:35 pm Post subject: |
|
|
pa4wdh wrote: |
logrusx wrote: | It looks like unexpected side effect |
No, it's completely intended and expected. My use-case is to have it running all the time, if it exists for whatever reason if should take safety measures. |
It may be your intention and expectation but in general nobody would reasonably expect it. I personally will sync the previous version. It worked good enough for me.
Best Regards,
Georgi |
|
Back to top |
|
|
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3810 Location: Rasi, Finland
|
Posted: Fri Aug 16, 2024 7:55 pm Post subject: |
|
|
logrusx wrote: | It may be your intention and expectation but in general nobody would reasonably expect it. I personally will sync the previous version. It worked good enough for me.
Best Regards,
Georgi | I think that reasonable default to drop to lowest speed. However maybe there should be a way to override this default in some way. _________________ ..: Zucca :..
My gentoo installs: | init=/sbin/openrc-init
-systemd -logind -elogind seatd |
Quote: | I am NaN! I am a man! |
|
|
Back to top |
|
|
pa4wdh l33t
Joined: 16 Dec 2005 Posts: 892
|
Posted: Sat Aug 17, 2024 5:37 am Post subject: |
|
|
From our discussion here we can see points-of-view differ on this matter, so an option to control this behavior seems the way to go. My idea is to add an option to keep things as-is on a normal exit (so it sticks to whatever the program set as last value), on an abnormal exit (failure of some kind) i think it should always do some kind of failsafe.
Would that work for you? _________________ The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world
My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com |
|
Back to top |
|
|
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3810 Location: Rasi, Finland
|
Posted: Sun Aug 18, 2024 7:28 am Post subject: |
|
|
pa4wdh wrote: | Would that work for you? | I'm fine with the current behavior.
But as you may know when the user base grows, so does the amount of requested configuration options.
So If you want to please everyone have options for:- normal exit governor and frequencies
- abnormal exit governor and frequencies
An example of both: Code: | --exit performance 1400000 2100000 --failsafe powersave 1400000 1400000 | ... and if unset fallback to minimum frequency. _________________ ..: Zucca :..
My gentoo installs: | init=/sbin/openrc-init
-systemd -logind -elogind seatd |
Quote: | I am NaN! I am a man! |
|
|
Back to top |
|
|
pa4wdh l33t
Joined: 16 Dec 2005 Posts: 892
|
Posted: Sun Aug 18, 2024 11:44 am Post subject: |
|
|
Pleasing everyone indeed leads to a lot of options. That's why i'm looking for something that's easy to implement and does enough to help with the issues.
Your suggestion looks nice, but with current parameter parsing this isn't easy to do. I'm using getopt (see man 3 getopt) which can handle simple switches (like -m) and arguments which take a single argument (like -i <sensor>). _________________ The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world
My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com |
|
Back to top |
|
|
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3810 Location: Rasi, Finland
|
Posted: Sun Aug 18, 2024 2:46 pm Post subject: |
|
|
Then maybe just implement "exit governor" and "failsafe governor" and just let frequency go as high as the governor allows?
Failsafe governor being 'powersave' by default and exit governor being the one being used when running cputemp2maxfreq by default. _________________ ..: Zucca :..
My gentoo installs: | init=/sbin/openrc-init
-systemd -logind -elogind seatd |
Quote: | I am NaN! I am a man! |
|
|
Back to top |
|
|
pa4wdh l33t
Joined: 16 Dec 2005 Posts: 892
|
Posted: Sun Aug 25, 2024 3:47 pm Post subject: |
|
|
I just updated the repo (no ebuild yet). Most important changes:
- Added the -k option as proposed a few posts back to keep the last state instead of setting the lowest possible frequency
- Added multi-CPU support (also makes it a tiny bit more efficient on single-CPU machines), added -P parameter for that
- Added a manpage
- Added -Wall and -Werror to CFLAGS in the Makefile and fixed the errors it came up with _________________ The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world
My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com
Last edited by pa4wdh on Sun Aug 25, 2024 5:24 pm; edited 1 time in total |
|
Back to top |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2542
|
Posted: Sun Aug 25, 2024 4:06 pm Post subject: |
|
|
Great!
I haven't used it for a while, no big builds necessitated it, but will report when I use it. For now I just started it to se how it behaves. No surprises.
Best Regards,
Georgi |
|
Back to top |
|
|
pa4wdh l33t
Joined: 16 Dec 2005 Posts: 892
|
Posted: Wed Sep 04, 2024 9:09 am Post subject: |
|
|
I've just made a new release with a new ebuild.
I've added some more compiler flags to catch coding errors, and made it more explicit the code is GPL3 (this was already stated in the ebuild, but now it contains the license and copyright headers).
Ebuild and manifest can be found here: https://code.pa4wdh.nl.eu.org/tools/cputemp2maxfreq/tree/gentoo _________________ The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world
My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com |
|
Back to top |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2542
|
Posted: Thu Sep 19, 2024 12:46 pm Post subject: |
|
|
Hello, is your daemon compatible with 6.1 kernels? It says invalid CPU data and I was wondering if it's my mistake.
Best Regards,
Georgi |
|
Back to top |
|
|
pa4wdh l33t
Joined: 16 Dec 2005 Posts: 892
|
Posted: Thu Sep 19, 2024 5:45 pm Post subject: |
|
|
I am not aware of issues with 6.1 kernels, I've run it myself on 6.1 and now on 6.6 kernels.
What values does it report?
These are the hardcoded limits (from cputemp2maxfreq.h):
Code: |
// Valid frequencies are between 100MHz and 10GHz
#define VALID_FREQ_MIN 100000
#define VALID_FREQ_MAX 10000000
// Valid frequency steps are between 1MHz and 1GHz
#define VALID_STEP_MIN 1000
#define VALID_STEP_MAX 1000000
// Valid temperatures are between 10 and 150 degrees
#define VALID_TEMP_MIN 10000
#define VALID_TEMP_MAX 150000
// Valid intervals are between 1 and 30
#define VALID_INTERVAL_MIN 1
#define VALID_INTERVAL_MAX 30
// Valid transition delays between 0 and 100000
#define VALID_TRANS_MIN 0
#define VALID_TRANS_MAX 100000
|
_________________ The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world
My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com |
|
Back to top |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2542
|
Posted: Thu Sep 19, 2024 5:56 pm Post subject: |
|
|
It was my mistake, sorry. Amd-pstate driver requires a boot command line argument and while investigating my resume from sleep issue, I have somehow lost it. I just found out and was about to delete mu post but you were faster :)
Best Regards,
Georgi |
|
Back to top |
|
|
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3810 Location: Rasi, Finland
|
Posted: Fri Sep 20, 2024 6:45 am Post subject: |
|
|
I'll test the 0.6 version this weekend.
All the published versions are on my repo as well. ;) _________________ ..: Zucca :..
My gentoo installs: | init=/sbin/openrc-init
-systemd -logind -elogind seatd |
Quote: | I am NaN! I am a man! |
|
|
Back to top |
|
|
pa4wdh l33t
Joined: 16 Dec 2005 Posts: 892
|
Posted: Fri Sep 20, 2024 6:50 am Post subject: |
|
|
@logrusx: Good you found the issue.
@Zucca: Thanks for the update.
I'm working on a new one, primarily with some small (bug)fixes. _________________ The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world
My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com |
|
Back to top |
|
|
pa4wdh l33t
Joined: 16 Dec 2005 Posts: 892
|
Posted: Wed Oct 09, 2024 10:40 am Post subject: |
|
|
I just pushed some changes to my repo, including a new ebuild.
Just some small changes this time, no new features.
The most notable change is that scaling_max_freq is now read every poll interval (just like the temperature and current frequency), in previous releases this was done only after changing it. This change means is deals better with situations where something else has changed scaling_max_freq between polls.
I was in doubt if i should call it 0.6.1 or 0.7 because the changes are so small, but since this is a very small project anyway i decided to call it 0.7 . _________________ The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world
My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com |
|
Back to top |
|
|
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3810 Location: Rasi, Finland
|
Posted: Sun Dec 29, 2024 10:46 am Post subject: |
|
|
Somewhat off topic: Does intel CPUs generally benefit more of this daemon?
I haven't dug much info, but looking at htop and other sysmons on my boxes, it looks like most intel CPU can change cpu frequency very gradually, instead of rough steps.
My Ryzen based laptop has the following: Code: | available frequency steps: 2.10 GHz, 1.70 GHz, 1.40 GHz | , only three stages of CPU frequency.
I've been toying with an idea of building some µATX or even miniITX workstation. I'll probably place some high TDP CPU there, and would like to use cputemp2maxfreq to limit the performance when on "silent-mode".
So would choosing Intel be a better choice compared to AMD? _________________ ..: Zucca :..
My gentoo installs: | init=/sbin/openrc-init
-systemd -logind -elogind seatd |
Quote: | I am NaN! I am a man! |
|
|
Back to top |
|
|
logrusx Advocate
Joined: 22 Feb 2018 Posts: 2542
|
Posted: Sun Dec 29, 2024 12:11 pm Post subject: |
|
|
It looks like you're using ACPI-cpufreq. Afair it provides only 3 states.
Best Regards,
Georgi |
|
Back to top |
|
|
Zucca Moderator
Joined: 14 Jun 2007 Posts: 3810 Location: Rasi, Finland
|
Posted: Sun Dec 29, 2024 6:28 pm Post subject: |
|
|
SPLIT: amd-pstate conversation continues here. _________________ ..: Zucca :..
My gentoo installs: | init=/sbin/openrc-init
-systemd -logind -elogind seatd |
Quote: | I am NaN! I am a man! |
|
|
Back to top |
|
|
|