All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomasz Chmielewski <tch@virtall.com>
To: Nikolay Borisov <nborisov@suse.com>
Cc: Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: btrfs-cleaner 100% busy on an idle filesystem with 4.19.3
Date: Thu, 22 Nov 2018 22:07:25 +0900	[thread overview]
Message-ID: <0df02574bdf0fb676cee7b5a3d1890e3@virtall.com> (raw)
In-Reply-To: <f9e07d50-be2e-36fb-8953-2419200522f0@suse.com>

On 2018-11-22 21:46, Nikolay Borisov wrote:

>> # echo w > /proc/sysrq-trigger
>> 
>> # dmesg -c
>> [  931.585611] sysrq: SysRq : Show Blocked State
>> [  931.585715]   task                        PC stack   pid father
>> [  931.590168] btrfs-cleaner   D    0  1340      2 0x80000000
>> [  931.590175] Call Trace:
>> [  931.590190]  __schedule+0x29e/0x840
>> [  931.590195]  schedule+0x2c/0x80
>> [  931.590199]  schedule_timeout+0x258/0x360
>> [  931.590204]  io_schedule_timeout+0x1e/0x50
>> [  931.590208]  wait_for_completion_io+0xb7/0x140
>> [  931.590214]  ? wake_up_q+0x80/0x80
>> [  931.590219]  submit_bio_wait+0x61/0x90
>> [  931.590225]  blkdev_issue_discard+0x7a/0xd0
>> [  931.590266]  btrfs_issue_discard+0x123/0x160 [btrfs]
>> [  931.590299]  btrfs_discard_extent+0xd8/0x160 [btrfs]
>> [  931.590335]  btrfs_finish_extent_commit+0xe2/0x240 [btrfs]
>> [  931.590382]  btrfs_commit_transaction+0x573/0x840 [btrfs]
>> [  931.590415]  ? btrfs_block_rsv_check+0x25/0x70 [btrfs]
>> [  931.590456]  __btrfs_end_transaction+0x2be/0x2d0 [btrfs]
>> [  931.590493]  btrfs_end_transaction_throttle+0x13/0x20 [btrfs]
>> [  931.590530]  btrfs_drop_snapshot+0x489/0x800 [btrfs]
>> [  931.590567]  btrfs_clean_one_deleted_snapshot+0xbb/0xf0 [btrfs]
>> [  931.590607]  cleaner_kthread+0x136/0x160 [btrfs]
>> [  931.590612]  kthread+0x120/0x140
>> [  931.590646]  ? btree_submit_bio_start+0x20/0x20 [btrfs]
>> [  931.590658]  ? kthread_bind+0x40/0x40
>> [  931.590661]  ret_from_fork+0x22/0x40
>> 
> 
> It seems your filesystem is mounted with the DSICARD option meaning
> every delete will result in discard this is highly suboptimal for 
> ssd's.
> Try remounting the fs without the discard option see if it helps.
> Generally for discard you want to submit it in big batches (what fstrim
> does) so that the ftl on the ssd could apply any optimisations it might
> have up its sleeve.

Spot on!

Removed "discard" from fstab and added "ssd", rebooted - no more 
btrfs-cleaner running.

Do you know if the issue you described ("discard this is highly 
suboptimal for ssd") affects other filesystems as well to a similar 
extent? I.e. if using ext4 on ssd?


> Would you finally care to share the smart data + the model and make of
> the ssd?

2x these:

Model Family:     Samsung based SSDs
Device Model:     SAMSUNG MZ7LM1T9HCJM-00005
Firmware Version: GXT1103Q
User Capacity:    1,920,383,410,176 bytes [1.92 TB]
Sector Size:      512 bytes logical/physical
Rotation Rate:    Solid State Device

1x this:

Device Model:     Micron_5200_MTFDDAK1T9TDC
Firmware Version: D1MU004
User Capacity:    1,920,383,410,176 bytes [1.92 TB]
Sector Sizes:     512 bytes logical, 4096 bytes physical
Rotation Rate:    Solid State Device
Form Factor:      2.5 inches


But - seems the issue was unneeded discard option, so not pasting 
unnecessary SMART data, thanks for finding this out.


Tomasz Chmielewski

  reply	other threads:[~2018-11-22 13:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-22 12:31 btrfs-cleaner 100% busy on an idle filesystem with 4.19.3 Tomasz Chmielewski
2018-11-22 12:46 ` Nikolay Borisov
2018-11-22 13:07   ` Tomasz Chmielewski [this message]
2018-11-22 14:03     ` Roman Mamedov
2018-11-22 14:13       ` Qu Wenruo
2018-11-23  6:47     ` Chris Murphy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0df02574bdf0fb676cee7b5a3d1890e3@virtall.com \
    --to=tch@virtall.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.