You are not logged in.

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

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

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: 7,798

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: 4

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: 9,141
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 X299 TOMAHAWK ARCTIC // Processor: Intel Core i7-7820X 3.6GHz // GFX: nVidia GeForce GTX 970 // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 5x 1TB HDD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

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

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

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: 9

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: 4

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

Board footer

Powered by FluxBB