Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: btrfs and kde

  1. #1

    Default btrfs and kde

    This may not be the right forum... I installed a pair of identical Samsung 850 SSDs on a laptop, then installed 15.2 with Btrfs across both devices, with default "raid" (mirror metadata, stripe data; snapshots enabled). A more or less default install.
    (This is a valid configuration for a pair of SSDs to provide FS error correction.)
    fstab
    Code:
    UUID=2222222f-4861-8888-9509-81578864445f   /                       btrfs  compress=zlib                 0  0
    UUID=2222222f-4861-8888-9509-81578864445f   /.snapshots             btrfs  subvol=/@/.snapshots          0  0
    UUID=2222222g-69d8-4a50-ba80-81578864445f  swap                    swap   defaults                      0  0
    UUID=2222222f-4861-8888-9509-81578864445f   /var                    btrfs  subvol=/@/var                 0  0
    UUID=2222222f-4861-8888-9509-81578864445f   /usr/local              btrfs  subvol=/@/usr/local           0  0
    UUID=2222222f-4861-8888-9509-81578864445f   /tmp                    btrfs  subvol=/@/tmp                 0  0
    UUID=2222222f-4861-8888-9509-81578864445f   /srv                    btrfs  subvol=/@/srv                 0  0
    UUID=2222222f-4861-8888-9509-81578864445f   /root                   btrfs  subvol=/@/root                0  0
    UUID=2222222f-4861-8888-9509-81578864445f   /opt                    btrfs  subvol=/@/opt                 0  0
    UUID=2222222f-4861-8888-9509-81578864445f   /home                   btrfs  subvol=/@/home                0  0
    UUID=2222222f-4861-8888-9509-81578864445f   /boot/grub2/x86_64-efi  btrfs  subvol=/@/boot/grub2/x86_64-efi  0  0
    UUID=2222222f-4861-8888-9509-81578864445f   /boot/grub2/i386-pc     btrfs  subvol=/@/boot/grub2/i386-pc  0  0
    UUID=E4DD-244E                             /boot/efi               vfat   defaults                      0  2
    What I've noticed is that about once per day (usually on boot) kde freezes (partially or mostly), repeatedly, sometimes for a minute or two at a time. Gkrellm keeps running (as does the mouse pointer) and shows a single core at 100% utilization (as does htop) - which jumps occasionally between the cores (i7-4700MQ, 16GB). This behavior lasts 5 minutes or so, then everything goes back to normal.

    Ksysguard shows these are using that core thread:
    Code:
    btrfs-cleaner
    btrfs-group-rescan
    btrfs-transacti
    I am curious about whether this is expected behavior. I don't have autodefrag set.

  2. #2
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    4,043

    Question Re: btrfs and kde

    Quote Originally Posted by pattiM View Post
    I am curious about whether this is expected behavior.
    Possibly, the Btrfs Balance and/or Scrub and/or Fstrim services are running at every boot –
    • If you check the status of the “btrfs-balance.timer” and “btrfs-scrub.timer” and “btrfs-trim.timer” services, it should be possible to see if they triggered during the boot.

    Do you also have the (not Btrfs) “fstrim.timer” service enabled?
    • Disable it for the Btrfs Use Case – Btrfs has it's own Fstrim service …

  3. #3

    Lightbulb Re: btrfs and kde

    AFAIK Samsung 850 have troubles with TRIM/FSTRIM.
    And possibly troubles with NCQ.
    Check that.

    https://git.kernel.org/pub/scm/linux...ad2c8ae67acf81
    https://git.kernel.org/pub/scm/linux.../libata-core.c
    https://github.com/torvalds/linux/bl.../libata-core.c

    /* devices that don't properly handle queued TRIM commands */

    { "Samsung SSD 850*", NULL, ATA_HORKAGE_NO_NCQ_TRIM |
    ATA_HORKAGE_ZERO_AFTER_TRIM, },

  4. #4

    Default Re: btrfs and kde

    Quote Originally Posted by dcurtisfra View Post
    Possibly, the Btrfs Balance and/or Scrub and/or Fstrim services are running at every boot –
    • If you check the status of the “btrfs-balance.timer” and “btrfs-scrub.timer” and “btrfs-trim.timer” services, it should be possible to see if they triggered during the boot.

    Do you also have the (not Btrfs) “fstrim.timer” service enabled?
    • Disable it for the Btrfs Use Case – Btrfs has it's own Fstrim service …
    The YaST / System Services applet says "fstrim" is "dead" (i.e., starts only manually).

    Oops - all of them are inactive/dead and listed as "manually" start in that Yast applet... btrfs-balance, btrfs-defrag, btrfs-scrub, btrfs-trim, and btrfsmaintenance-refresh.

    But you asked about the timers...
    Code:
    # systemctl status btrfs-balance.timer
    ● btrfs-balance.timer - Balance block groups on a btrfs filesystem
       Loaded: loaded (/usr/lib/systemd/system/btrfs-balance.timer; enabled; vendor preset: enabled)
       Active: active (waiting) since Tue 2021-04-20 13:54:44 MST; 2 days ago
      Trigger: Sat 2021-05-01 00:00:00 MST; 1 weeks 1 days left
         Docs: man:btrfs-balance
    
    Apr 20 13:54:44 systemd[1]: Started Balance block groups on a btrfs filesystem.
    # systemctl status btrfs-scrub.timer
    ● btrfs-scrub.timer - Scrub btrfs filesystem, verify block checksums
       Loaded: loaded (/usr/lib/systemd/system/btrfs-scrub.timer; enabled; vendor preset: enabled)
       Active: active (waiting) since Tue 2021-04-20 13:54:44 MST; 2 days ago
      Trigger: Sat 2021-05-01 00:00:00 MST; 1 weeks 1 days left
         Docs: man:btrfs-scrub
    
    Apr 20 13:54:44 systemd[1]: Started Scrub btrfs filesystem, verify block checksums.
    # systemctl status btrfs-trim.timer
    ● btrfs-trim.timer - Discard unused blocks on a mounted filesystem
       Loaded: loaded (/usr/lib/systemd/system/btrfs-trim.timer; enabled; vendor preset: enabled)
       Active: active (waiting) since Tue 2021-04-20 13:54:44 MST; 2 days ago
      Trigger: Sat 2021-05-01 00:00:00 MST; 1 weeks 1 days left
         Docs: man:fstrim
    
    Apr 20 13:54:44 systemd[1]: Started Discard unused blocks on a mounted filesystem.
    These say ~2 days ago they ran? But the kde slowdown happened this morning (not during a boot) and also yesterday morning during a boot.

    # date
    Thu Apr 22 14:26:38 MST 2021

    Might have to search a system log or something?

  5. #5

    Default Re: btrfs and kde

    Quote Originally Posted by Svyatko View Post
    Thanks for the links - apparently this is "being worked with Samsung" - so that's good. I'm not sure what's invoking anything related to a TRIM.

  6. #6
    Join Date
    Jan 2018
    Location
    Canada
    Posts
    177

    Default Re: btrfs and kde

    I'm on TW but i expect the following would still be relevant. You can check btrfs actions in the log by:
    Code:
    journalctl --since "1 day ago" --unit=btrfs*
    However, if you only see lines similar to:
    Code:
    Apr 20 08:32:11 DOS1 systemd[1]: Started Balance block groups on a btrfs filesystem.
    Apr 20 08:32:11 DOS1 systemd[1]: Started Scrub btrfs filesystem, verify block checksums.
    these are just the timers kicking off on a boot.

    On a shutdown the logs will show:
    Code:
    Apr 05 10:41:02 DOS1 systemd[1]: btrfs-balance.timer: Succeeded.
    Apr 05 10:41:02 DOS1 systemd[1]: Stopped Balance block groups on a btrfs filesystem.
    Apr 05 10:41:02 DOS1 systemd[1]: btrfs-scrub.timer: Succeeded.
    Apr 05 10:41:02 DOS1 systemd[1]: Stopped Scrub btrfs filesystem, verify block checksums.
    If an actual balance takes place you will see something like:
    Code:
    Apr 19 00:00:11 DOS1 systemd[1]: Started Balance block groups on a btrfs filesystem.
    Apr 19 00:00:11 DOS1 btrfs-balance.sh[26797]: Before balance of /
    Apr 19 00:00:11 DOS1 btrfs-balance.sh[26797]: Data, single: total=136.01GiB, used=102.27GiB
    Apr 19 00:00:11 DOS1 btrfs-balance.sh[26797]: System, single: total=32.00MiB, used=16.00KiB
    Apr 19 00:00:11 DOS1 btrfs-balance.sh[26797]: Metadata, single: total=4.01GiB, used=2.28GiB
    Apr 19 00:00:11 DOS1 btrfs-balance.sh[26797]: GlobalReserve, single: total=190.66MiB, used=0.00B
    Apr 19 00:00:11 DOS1 btrfs-balance.sh[26797]: Filesystem      Size  Used Avail Use% Mounted on
    Apr 19 00:00:11 DOS1 btrfs-balance.sh[26797]: /dev/nvme0n1p2  998G  113G  884G  12% /
    Apr 19 00:00:11 DOS1 btrfs-balance.sh[26797]: Done, had to relocate 0 out of 143 chunks
    Apr 19 00:00:11 DOS1 btrfs-balance.sh[26797]: flock: getting lock took 0.000001 seconds
    Apr 19 00:00:11 DOS1 btrfs-balance.sh[26797]: flock: executing btrfs
    ....

  7. #7
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    31,068
    Blog Entries
    15

    Default Re: btrfs and kde

    Quote Originally Posted by pattiM View Post
    Thanks for the links - apparently this is "being worked with Samsung" - so that's good. I'm not sure what's invoking anything related to a TRIM.
    Hi
    I would not hold your breath 5 years and no action there are a few still blacklisted in libata
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  8. #8

    Default Re: btrfs and kde

    Quote Originally Posted by malcolmlewis View Post
    Hi
    I would not hold your breath 5 years and no action there are a few still blacklisted in libata
    Well, it's my own fault for not knowing about the blacklisting (Ignorance Is No Excuse). I would have bought different drives, maybe.

  9. #9

    Default Re: btrfs and kde

    OOoooo... This looks like good stuff. Thanks!

    Hmmm...

    Code:
    # journalctl --since "1 day ago" --unit=btrfs*
    -- Logs begin at Tue 2021-04-20 13:54:35 MST, end at Thu 2021-04-22 18:59:45 MST. --
    -- No entries --
     #
    Quote Originally Posted by doscott View Post
    I'm on TW but i expect the following would still be relevant. You can check btrfs actions in the log by:
    Code:
    journalctl --since "1 day ago" --unit=btrfs*
    However, if you only see lines similar to:
    Code:
    Apr 20 08:32:11 DOS1 systemd[1]: Started Balance block groups on a btrfs filesystem.
    Apr 20 08:32:11 DOS1 systemd[1]: Started Scrub btrfs filesystem, verify block checksums.
    these are just the timers kicking off on a boot.

    On a shutdown the logs will show:
    Code:
    Apr 05 10:41:02 DOS1 systemd[1]: btrfs-balance.timer: Succeeded.
    Apr 05 10:41:02 DOS1 systemd[1]: Stopped Balance block groups on a btrfs filesystem.
    Apr 05 10:41:02 DOS1 systemd[1]: btrfs-scrub.timer: Succeeded.
    Apr 05 10:41:02 DOS1 systemd[1]: Stopped Scrub btrfs filesystem, verify block checksums.
    If an actual balance takes place you will see something like:
    Code:
    Apr 19 00:00:11 DOS1 systemd[1]: Started Balance block groups on a btrfs filesystem.
    Apr 19 00:00:11 DOS1 btrfs-balance.sh[26797]: Before balance of /
    Apr 19 00:00:11 DOS1 btrfs-balance.sh[26797]: Data, single: total=136.01GiB, used=102.27GiB
    Apr 19 00:00:11 DOS1 btrfs-balance.sh[26797]: System, single: total=32.00MiB, used=16.00KiB
    Apr 19 00:00:11 DOS1 btrfs-balance.sh[26797]: Metadata, single: total=4.01GiB, used=2.28GiB
    Apr 19 00:00:11 DOS1 btrfs-balance.sh[26797]: GlobalReserve, single: total=190.66MiB, used=0.00B
    Apr 19 00:00:11 DOS1 btrfs-balance.sh[26797]: Filesystem      Size  Used Avail Use% Mounted on
    Apr 19 00:00:11 DOS1 btrfs-balance.sh[26797]: /dev/nvme0n1p2  998G  113G  884G  12% /
    Apr 19 00:00:11 DOS1 btrfs-balance.sh[26797]: Done, had to relocate 0 out of 143 chunks
    Apr 19 00:00:11 DOS1 btrfs-balance.sh[26797]: flock: getting lock took 0.000001 seconds
    Apr 19 00:00:11 DOS1 btrfs-balance.sh[26797]: flock: executing btrfs
    ....

  10. #10

    Default Re: btrfs and kde

    Hmmm... curiouser and curiouser... I'm not actually sure what's running here. I know something ran today (the 22nd).

    Code:
    #> journalctl --since "3 days ago" --unit=btrfs*
    -- Logs begin at Tue 2021-04-20 13:54:35 MST, end at Thu 2021-04-22 19:09:40 MST. --
    Apr 20 13:54:43 linux systemd[1]: Started Watch /etc/sysconfig/btrfsmaintenance.
    Apr 20 13:54:44 linux systemd[1]: Started Scrub btrfs filesystem, verify block checksums.
    Apr 20 13:54:44 linux systemd[1]: Started Defragment file data and/or directory metadata.
    Apr 20 13:54:44 linux systemd[1]: Started Balance block groups on a btrfs filesystem.
    Apr 20 13:54:44 linux systemd[1]: Started Discard unused blocks on a mounted filesystem.
    #>

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •