You are not logged in.

#1 2019-05-10 12:06:03

tinux
Member
Registered: 2019-05-10
Posts: 6

btrfs-cleaner running forever

I am using LUKS encrypted BTRFS partitions on a couple of systems (all with SSDs), but on one I am facing issues with `btrfs-cleaner` running forever, and utilizing one core of that system.

The problem is not too easy to pinpoint, since I also cannot trigger it. After rebooting the system, everything looks normal. I can create and delete snapshots (I'm using snapper typically) without any issues. Also scrubbing works without any problems or errors. This normal state can last for hours (maybe even days), but at some point I am getting this in `top`

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                   
  532 root      20   0       0      0      0 R 100.0   0.0   3068:27 btrfs-cleaner

and this in `iotop`

  TID  PRIO  USER     DISK READ  DISK WRITE  SWAPIN     IO>    COMMAND                         
  532 be/4 root        0.00 B/s    2.26 G/s  0.00 %  0.00 % [btrfs-cleaner]

Some online research seems to indicate that it could maybe be related to btrfs quotas or that the drive is failing. However, quotas aren't enabled, and the drive seems fine (I think):

# smartctl -A /dev/sda
smartctl 7.0 2018-12-30 r4883 [x86_64-linux-5.0.13-arch1-1-ARCH] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 1
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Reallocated_Sector_Ct   0x0033   100   100   010    Pre-fail  Always       -       0
  9 Power_On_Hours          0x0032   097   097   000    Old_age   Always       -       14304
 12 Power_Cycle_Count       0x0032   099   099   000    Old_age   Always       -       26
177 Wear_Leveling_Count     0x0013   099   099   000    Pre-fail  Always       -       14
179 Used_Rsvd_Blk_Cnt_Tot   0x0013   100   100   010    Pre-fail  Always       -       0
181 Program_Fail_Cnt_Total  0x0032   100   100   010    Old_age   Always       -       0
182 Erase_Fail_Count_Total  0x0032   100   100   010    Old_age   Always       -       0
183 Runtime_Bad_Block       0x0013   100   100   010    Pre-fail  Always       -       0
187 Uncorrectable_Error_Cnt 0x0032   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0032   076   066   000    Old_age   Always       -       24
195 ECC_Error_Rate          0x001a   200   200   000    Old_age   Always       -       0
199 CRC_Error_Count         0x003e   100   100   000    Old_age   Always       -       0
235 POR_Recovery_Count      0x0012   099   099   000    Old_age   Always       -       16
241 Total_LBAs_Written      0x0032   099   099   000    Old_age   Always       -       17939834361

The drive is a Samsung SSD 850 EVO 250GB and I am using this in `/etc/fstab`:

UUID=50e7187f-5619-43ef-9625-a8084bca51c1	/         		btrfs  	rw,noatime,compress=lzo,ssd,discard,space_cache,subvol=@ROOT					0 0
UUID=50e7187f-5619-43ef-9625-a8084bca51c1	/.snapshots   		btrfs  	rw,noatime,compress=lzo,ssd,discard,space_cache,subvol=@SNAPSHOTS				0 0
UUID=50e7187f-5619-43ef-9625-a8084bca51c1	/var			btrfs  	rw,noatime,compress=lzo,ssd,discard,space_cache,subvol=@VAR					0 0

Any idea on resolving this issue or even triggering the issue in order to find a solution is highly appreciated.

Offline

#2 2019-05-10 12:18:57

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: btrfs-cleaner running forever

Check dmesg if you see any failures.

FWIW Samsung SSDs are notorious for not playing well with power management, try if you see an improvement by switching to max_performance: https://wiki.archlinux.org/index.php/Po … Management

Offline

#3 2019-05-10 12:22:15

tinux
Member
Registered: 2019-05-10
Posts: 6

Re: btrfs-cleaner running forever

Thanks for your response, V1del!

V1del wrote:

Check dmesg if you see any failures.

dmesg did not show anything. Sorry, I forgot to mention that.

V1del wrote:

FWIW Samsung SSDs are notorious for not playing well with power management, try if you see an improvement by switching to max_performance: https://wiki.archlinux.org/index.php/Po … Management

I will enable this right now! Let us see what is happening. Thanks!

[edit]
Actually, it was on max_performance already.

$ cat /sys/class/scsi_host/host*/link_power_management_policy
max_performance
max_performance
max_performance
max_performance
max_performance
max_performance
max_performance
max_performance
max_performance

[/edit]

Last edited by tinux (2019-05-10 12:23:59)

Offline

#4 2019-05-10 12:29:27

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,787
Website

Re: btrfs-cleaner running forever

What is 'btrfs-cleaner', and what does it do? It's not provided by any Arch package, and isn't listed on the wiki.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#5 2019-05-10 13:07:33

tinux
Member
Registered: 2019-05-10
Posts: 6

Re: btrfs-cleaner running forever

WorMzy wrote:

What is 'btrfs-cleaner', and what does it do? It's not provided by any Arch package, and isn't listed on the wiki.

It does not come with any package. I assume it is a kernel process.

As to its function, where I am also not sure, I think it is involved in removing snapshots, but I do not know if it is limited to that.

Offline

#6 2019-05-10 13:32:48

dilyn
Member
From: Lansing, MI
Registered: 2014-07-16
Posts: 11

Re: btrfs-cleaner running forever

Looks like it's a feature of BTRFS.

Prevailing suggestion seems to be to disable quotas:

 btrfs quota disable /

Offline

#7 2019-05-10 13:34:38

tinux
Member
Registered: 2019-05-10
Posts: 6

Re: btrfs-cleaner running forever

dilyn wrote:

Looks like it's a feature of BTRFS.

Prevailing suggestion seems to be to disable quotas:

 btrfs quota disable /

That is also what I found when I searched online for this issue. However, as I said in the initial post, quotas are disabled.

Offline

#8 2020-08-25 20:19:23

emphire
Member
From: Canada
Registered: 2007-03-21
Posts: 203

Re: btrfs-cleaner running forever

I switched to linux-zen and I'm having the same issue. I might try the default kernel next time I reboot. Was curious if you're using an alternative kernel and if there's any link to that.

Offline

#9 2020-08-25 22:13:49

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 4,645

Re: btrfs-cleaner running forever

emphire, this topic is a year old and the OP has not been back to the forum for several months (and has apparently abandoned this topic). Please do not necrobump; instead, start your own topic and refer back to this one if you think it applies.

Closing this old topic. tinux, if you come back and want this topic reopened, please use the Report link.


How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.

Offline

Board footer

Powered by FluxBB