Troubles regarding laptop fan speed, sleep and overall performance

Hello there! I’ve been daily driving fedora for around 1-2 months now. My overall experience has been positive. fluid ui, customization, tiling managers, its been great. I do have a few problems that I’ve tried multiple times to fix, but have persisted throughout the weeks. I hope i can get them fixed here

Before I get to it, I am running a Lenovo Legion Slim 5 16AHP9 model. It has an AMD 8845 HS chip and a NVIDIA 4060 GPU. I have a dual boot setup with windows on a seperate ssd. these problems do not happen on windows so its exclusive to linux.

The first issue i have is with sleep. Whenever my laptop goes to sleep, the fans do this weird thing where every 2 seconds, they turn off, then start running, then turn off, then start running again. this happens even when theres 0 apps running in the laptop, and its usually quieter when the laptop is NOT sleeping which is very counterintuitive.

I tried fixing this by trying to circumvent the “Modern standby” thing and changing my sleep state from s2idle to deep sleep. But when i ran the command below to check, i only got the option of s2idle. So that was a no go. i tried to see if i could enable a deep sleep mode in the bios, but to no avail

cat /sys/power/mem_sleep 

The second issue i have is the system sometimes overloads and stops working entirely. It’s not because I’m trying to run too many processes at once, because my laptop doesn’t get warm and my cpu usage doesn’t reach 100. i think it has something to do with ram/ swap. the apps run fine for 2-3 hours super smoothly, then all of a sudden out of nowhere the system starts to lag super hard and im forced to restart. I did notice that when i do some gaming / running slightly heavier apps, after a while my swap memory gets fully maxxed out.

To fix this i searched a bit about swap memory. Apparently it’s recommended to have same amount of swap memory as your ram? i had 16 gb of ram but only 8 gb of swap. so i created a swap file for 8 gb and now i have 16 gb in my swap. I haven’t tested this yet since it’s only been a day since i’ve made this change. but hopefully this will fix it.

After doing this and installing system updates, my laptop got the “Hibernate” option near the sleep option in the fedora ui. i tried fiddling with it but it basically either turned off the laptop, or kept the laptop in a perpetual sleep state where i wasnt really able to wake it back up and had to force restart. it did work a minority of the times though. and the fans didnt do the annoying thing of turning off and on but they were still spinning, more than what id like them to and more than they do on windows when i put the laptop to sleep.

Other issues are mostly just performance related. But i assume they would be better if i figure out the issue causing my laptop to crash / fans to tweak out. the fans also in general sometimes ramp up for no reason, the laptop would be cold but the fans would get super loud just because its on performance mode. They still are controllable via the power modes in my laptop though, so thats good.

I hope you guys in the community can help me with my troubles, and i wish you all a good day!

On laptops, cooling is normally controlled by the hardware independently of the OS.

Based on the combination of fan speed and performance lagging, it sounds a lot like thermal throttling. Even though the laptop doesn’t feel warm, the CPU, GPU, mainboard and/or other components could still be running hotter than normal.

Install the lm_sensors package, then run sensors-detect to configure it for your hardware. To check the current temperature of various components, use the sensors command. Whenever the laptop’s performance drops, check the temperatures.

On modern OSes, there can be lots (e.g. hundreds) of system processes, so zero userland apps running is only a tiny portion of the overall picture. There could a background service that’s chewing up CPU and RAM, so use tools such as htop and iotop to monitor things.

As for swap size, with 16GB of physical RAM, unless you’re video editing, playing a big game, or perhaps a LLM, swapping to disk should be relatively rare. When performance lags, use the free command to check memory usage.

There was a time when the general advice was to size swap equal to physical RAM, but nowadays 8GB is just Fedora’s default based on the amount of physical RAM. Having more swap isn’t necessarily a good thing because it’s still thousands of times slower than physical RAM.

Fedora’s default Linux kernel “swappiness” is 60 (the lower the number, the less aggressive unused pages are swapped out). The following command shows the current setting:

cat /proc/sys/vm/swappiness
1 Like

That was before CPU’s got much faster. That allowed swap to RAM with compression, which is called zswap, but memory is generally highly compressible, so 8GB of zswap in RAM handles typical workloads with RAM of 16 to 32GB.

1 Like

Hibernate requires a physical swap space (partition or file) at least as large as the system RAM. With less physical swap space hibernation is impossible. The default fedora swap is 8GB of ZRAM which is located in the physical ram on the system. If you intend to use hibernation you must expand the physical portion to a minimum (for you) of 16GB.

How are you measuring that the swap is getting full?

Without knowing what apps you are using and exactly how you are doing it, this almost sounds like it may be a heat issue. Most laptops have air intake on the bottom and if anything is blocking air flow it can cause rapid overheating of cpu or gpu without being physically evident on the case to the user. Something as simple as having the laptop on your lap, on a soft surface, or similar can contribute to these issues.

Not by itself, and not going to allow hibernation with 16G of ram and only 8G of physical swap file. I also have to ask if you are using BTRFS and if that swap file is located in the BTRFS file system? If so then there are other issues involved that may bite your butt in doing so without special configs.

Overall I am thinking possibly heat or possibly an app with a memory leak that fills up swap.

Fans remaining on when sleeping/suspended is not normal and usually seems to indicate the system is not actually entering the sleep state properly.

i checked and its 60 for me too, but it does regularly get full, even when my ram is not necessarily maxxed out. I do play games (not big AAA titles so not that heavy), video edit and use CLion for programming though which is a pretty heavy IDE

I used system monitor to check when my laptop was lagging a lot / fans were maxxing out and it was like 10 percent cpu and gpu being used

system monitor

oh i didnt know that, i am using the brtfs file system and just made a swap file based on a guide i found online. It does show 16gb now total in system monitor though. but i assume for hibernate to work i need to have a single swap File thats 16gb large, accounting to 24 gb total

yea this is one of the main issues because it also keeps turning them on and off in an almost rhythmic fashion, it feels like my fans could get damaged if its being changed so rapidly

i don’t think its a thermal throttling problem because i dont have this happen when running heavy apps on windows, and this laptop has great thermals and heat dissipation by itself

i think the laptop tries to go to sleep but theres some conflict with the software and the bios making it do the weird fan thing… but i have no idea how to check or fix this… any help will be greatly appreciated :sob:

1 Like

Yes, Its a kernel / hardware bug.
Seeing lots of this lately.

any solutions / possible fixes? its the only thing putting me on the edge of fully committing to fedora

https://github.com/johnfanv2/LenovoLegionLinux has reverse engineered tools for monitoring and managing the things you mention, available at https://copr.fedorainfracloud.org/coprs/mrduarte/LenovoLegionLinux/.

i tried installing this but i was stuck at one of the steps that was sited as a source of error, so i uninstalled it. maybe ill try it again, but as far as i know its not supported anymore as well

You should gather details of the issue and report it on the github site if it has not already been reported.

It’s really up to your vendor to ensure that the kernel can work properly with your PC. While this is probably not going to happen, you should write to the vendor and let them know the issue.
Second, you may be able to get help (and help others) by filing a bug report at bugzilla.redhat.com but the amount of work for the amount of people is disproportionate, so maybe yes maybe no.

It’s one of those ongoing issues, that I would like to see vendors take more of an interest in.

okayy i understand, kinda unfortunate that theres no “fix” to this… do you know of any distros that are better supported on my laptop / lenovo products in general? or is there a different edition of fedora that would work better?

Sometimes the next kernel fixes it. Sometimes not. You could try to enable updates-testing and get the bleeding edge kernel.

Fedora’s kernel is very close to the upstream kernel.

I don’t have experience with any other distros at this time. I don’t like reddit, but there are a lot of multi-distro users there…

Okayy thank you! and thanks everyone who helped!