Btrfs-cleaner going hard on CPU

Since I like to use Linux more than Windows in general, I am using a Linux system on my schools’ computer (with permission). To my personal dismay, their computers don’t have particularly strong components. Given that EndeavourOS seems to be MUCH more lightweight compared to Windows on my personal machine, I thought this wouldn’t be an issue, but damn does it go hard on the single-threaded quadcores my school uses.

Other than Baloo file indexer, which I already read about on Reddit, a major problem seems to be a process listed in gtop as “btrfs-cleaner”, a process I’ve never thus far noticed on my personal machine. It runs for ages - possibly doesn’t stop at all - and uses up the CPU a lot. Total CPU usage can spike up to >60% at least once per minute while otherwise remaining entirely idle.

Unfortunately, I couldn’t find much about this online. The only one thing I found was something about auto defrag, but apparently that has already been fixed? Please advise.

If that is relevant, I use an AMD 5600X on my personal machine, while my schools’ computers are equipped with Intel Core i5-6600 CPUs.

If you have autodefrag settings in /etc/fstab try to remove it.
Make backup before editing fstab file: sudo cp /etc/fstab /etc/fstab.bak
Once you have removed autodefrag part, run sudo mount -a to check that there are no invalid entries in the fstab file. And then reboot just in case.

About that Baloo eating resources.

Are you using Timeshift?

1 Like

To my surprise, it was indeed enabled - on all partitions listed, except for swap and tmpfs. So, after I re-installed EndeavourOS from scratch (because I temporarily replaced it with Fedora), I removed autodefrag everywhere and the CPU is doing fine now. :slight_smile: Given that I don’t work with HDDs anymore whatsoever, I think I’ll do this on my main machine as well, maybe that’ll extend the lifespan of my SSDs a little.

I didn’t do anything with Baloo yet, I’ll try that to maybe squeeze out a few more FPS for the few games I can play on this computer, but the autodefrag thing really fixed the major problem I had - so thank you a lot!

That’s affirmative.

1 Like

Timeshift can sometimes cause similar problems if it has a lot of snapshots and btrfs groups are enabled.

Anyway glad you got your machine fixed.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.