btrfs-transacti and btrf-cleaner

I’m having a very strange issue. So, yesterday evening two processes suddenly appeared: btrfs-transacti and btrfs-cleaner. They loaded up all 8 threads of my 4/8 CPU to 100% at 3200mHz turboboost.
I decided to let them do what they want to do (the PC was unusable during this time). After about an hour I shut down my PC and went to sleep.

Today I turned my PC on and again these two processes load up my CPU to maximimum. I looked in /etc/crom.daily and there is a file called “suse-texlive” (I installed LaTex yesterday and multiple Python3 packages).

I’m new to btrfs and I have absolutely no idea what is going on. Is everything ok? If so, what exactly is going on and when it will end? If not, what do I do? And how to prevent this in the future?

Update: I found this thread:
https://www.reddit.com/r/openSUSE/comments/7t56lh/btrfscleaner/
And running ‘btrfs quota disable /’ stopped the processes. But I don’t know what exactly happened, so help is still needed

Some observations when using btrfs:

linux-udd7:~ # journalctl -b -u btrfs*
-- Logs begin at Sun 2018-09-23 15:19:45 CEST, end at Fri 2019-04-26 10:39:11 CEST. --
Apr 26 09:52:16 linux-udd7 systemd[1]: Started Watch /etc/sysconfig/btrfsmaintenance.
Apr 26 09:52:16 linux-udd7 systemd[1]: Starting Update cron periods from /etc/sysconfig/btrfsmaintenance...
Apr 26 09:52:16 linux-udd7 btrfsmaintenance-refresh-cron.sh[1042]: Refresh script btrfs-scrub.sh for uninstall
Apr 26 09:52:16 linux-udd7 btrfsmaintenance-refresh-cron.sh[1042]: Refresh script btrfs-defrag.sh for uninstall
Apr 26 09:52:16 linux-udd7 btrfsmaintenance-refresh-cron.sh[1042]: Refresh script btrfs-balance.sh for uninstall
Apr 26 09:52:16 linux-udd7 btrfsmaintenance-refresh-cron.sh[1042]: Refresh script btrfs-trim.sh for uninstall
Apr 26 09:52:16 linux-udd7 btrfsmaintenance-refresh-cron.sh[1042]: Refresh timer btrfs-scrub for monthly
Apr 26 09:52:17 linux-udd7 systemd[1]: Started Scrub btrfs filesystem, verify block checksums.
Apr 26 09:52:17 linux-udd7 systemd[1]: Started Balance block groups on a btrfs filesystem.
Apr 26 09:52:17 linux-udd7 btrfsmaintenance-refresh-cron.sh[1042]: Refresh timer btrfs-defrag for none
Apr 26 09:52:17 linux-udd7 btrfsmaintenance-refresh-cron.sh[1042]: Refresh timer btrfs-balance for weekly
Apr 26 09:52:18 linux-udd7 btrfsmaintenance-refresh-cron.sh[1042]: Refresh timer btrfs-trim for none
Apr 26 09:52:19 linux-udd7 systemd[1]: btrfsmaintenance-refresh.service: Succeeded.
Apr 26 09:52:19 linux-udd7 systemd[1]: Started Update cron periods from /etc/sysconfig/btrfsmaintenance.
linux-udd7:~ # 

Enabled snapper by running “snapper -c root create-config /”

linux-udd7:~ # snapper list
 # | Type   | Pre # | Date                     | User | Cleanup  | Description | Userdata
---+--------+-------+--------------------------+------+----------+-------------+---------
0  | single |       |                          | root |          | current     |         
1  | single |       | Fri Apr 26 10:00:00 2019 | root | timeline | timeline    |         
linux-udd7:~ # 
linux-udd7:~ # systemctl list-timers 
NEXT                          LEFT        LAST                          PASSED       UNIT                         ACTIVATES
Fri 2019-04-26 11:00:00 CEST  20min left  Fri 2019-04-26 10:00:00 CEST  39min ago    snapper-timeline.timer       snapper-timeline.service
Sat 2019-04-27 00:00:00 CEST  13h left    Fri 2019-04-26 09:52:17 CEST  47min ago    logrotate.timer              logrotate.service
Sat 2019-04-27 00:00:00 CEST  13h left    Fri 2019-04-26 09:52:17 CEST  47min ago    mandb.timer                  mandb.service
Sat 2019-04-27 00:44:20 CEST  14h left    Fri 2019-04-26 09:52:17 CEST  47min ago    backup-rpmdb.timer           backup-rpmdb.service
Sat 2019-04-27 01:02:43 CEST  14h left    Fri 2019-04-26 09:52:17 CEST  47min ago    backup-sysconfig.timer       backup-sysconfig.service
Sat 2019-04-27 01:06:39 CEST  14h left    Fri 2019-04-26 09:52:17 CEST  47min ago    check-battery.timer          check-battery.service
Sat 2019-04-27 10:02:11 CEST  23h left    Fri 2019-04-26 10:02:11 CEST  37min ago    snapper-cleanup.timer        snapper-cleanup.service
Sat 2019-04-27 10:07:11 CEST  23h left    Fri 2019-04-26 10:07:11 CEST  32min ago    systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Mon 2019-04-29 00:00:00 CEST  2 days left Thu 2019-04-25 08:22:20 CEST  1 day 2h ago btrfs-balance.timer          btrfs-balance.service
Mon 2019-04-29 00:00:00 CEST  2 days left Thu 2019-04-25 08:22:20 CEST  1 day 2h ago fstrim.timer                 fstrim.service
Wed 2019-05-01 00:00:00 CEST  4 days left Thu 2019-04-25 08:22:20 CEST  1 day 2h ago btrfs-scrub.timer            btrfs-scrub.service

11 timers listed.
Pass --all to see loaded but inactive timers, too.
linux-udd7:~ # 

No annoying jobs observed so far:

linux-udd7:~ # journalctl -b -u snapper*
-- Logs begin at Sun 2018-09-23 15:19:45 CEST, end at Fri 2019-04-26 10:42:16 CEST. --
Apr 26 09:52:16 linux-udd7 systemd[1]: Started Daily Cleanup of Snapper Snapshots.
Apr 26 09:52:17 linux-udd7 systemd[1]: Started Timeline of Snapper Snapshots.
Apr 26 10:00:00 linux-udd7 systemd[1]: Started Timeline of Snapper Snapshots.
Apr 26 10:00:00 linux-udd7 systemd-helper[3566]: running timeline for 'root'.
Apr 26 10:00:00 linux-udd7 systemd[1]: snapper-timeline.service: Succeeded.
Apr 26 10:02:11 linux-udd7 systemd[1]: Started Daily Cleanup of Snapper Snapshots.
Apr 26 10:02:11 linux-udd7 systemd-helper[3636]: running number cleanup for 'root'.
Apr 26 10:02:11 linux-udd7 systemd-helper[3636]: running timeline cleanup for 'root'.
Apr 26 10:02:11 linux-udd7 systemd-helper[3636]: running empty-pre-post cleanup for 'root'.
Apr 26 10:02:11 linux-udd7 systemd[1]: snapper-cleanup.service: Succeeded.
linux-udd7:~ # 

Yes, I’m having the exact same problem at this very moment on my laptop. Had to use another laptop 'cause the system is unusable as long as those processes run.
It seems to happen at certain intervals - always at the beginning of the month, but that might just be coincidence.
On my laptop it’s always the btrfs-transacti & btrfs processes that go into ‘disk sleep’ very often, probably causing the lockup.
Another strange thing is, that it never happens on my 2 desktops, only this one laptop…

I’ve been looking to solve this for ages now :frowning:

A search on btrfs-transacti turns up the following rather official “BTRFS gotchas” page which suggests the problem may be related to file fragmentation

https://btrfs.wiki.kernel.org/index.php/Gotchas

In any case,
I can’t imagine that any BTRFS maintenance utility should run even as a normal priority.

The process priority should be inspected (systemd Unit file?) and set properly,

In fact,
If you have a situation where you see the problem happening regularly, it would be immensely informative if you add the following lines to relevant Unit files

CPUSchedulingpriority=20

and possibly additionally

IOSchedulingpririty=6

After either or both of the above by the following to instantiate your changes

systemctl daemon-reload

And, if you find the above fixes your problem,
Then you can submit a bug describing in detail what you saw, and what you did to https://bugzilla.opensuse.org.

For more information on how you can take control of changing the processor or io scheduling property (ak niceness), the following are useful for understanding how to do this by configuring your systemd Unit files (which is a whole lot easier than before systemd)

An easy to read guide
http://bristot.me/setting-real-time-priorities-to-services-using-systemd/

The MAN pages
https://www.freedesktop.org/software/systemd/man/systemd.exec.html

TSU

…or simply install to EXT4 file system the next time. BTRFS is not ready for use by standard users and should not be the default.

Hi
A word of caution, these are technical forums, opinions are for other places in the forum or elsewhere on the internet. If you can’t offer some technical help (as per out T&C’s) then might I suggest skipping these threads…

I’m sorry, but BTRF is working perfectly here and should stay default. The given cmd lines in post #3 are all Ok here. Windows 10 sees smoke when dual boot for the main partition and Mini Tool Partition Wizard does not recognize the BTRF partition (unknown)[FONT=Liberation Serif].[/FONT]

This is perfect that way.

KsysGuard (System Monitor) should give an indication of what causes the CPU to saturate. For troubleshooting purposes, removing LaTex is another option and/or turn OFF turbo boost.