Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED sort of...] Kernel 5.5.9, btrfs and fstrim
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4399
Location: Dallas area

PostPosted: Wed Mar 18, 2020 10:12 am    Post subject: [SOLVED sort of...] Kernel 5.5.9, btrfs and fstrim Reply with quote

I compiled the latest 5.5 kernel and noticed some weirdness going on.

I boot into 5.5, looks ok, btrfs reports space in use/free properly.

I can run fstrim -v / which has ~143G free space and it shows that.
---
Get up the next morning (happens overnight) and run the same fstrim -v / and now it shows ~2.3G trimmed
and no matter how many time fstrim gets run it still says the same 2.3 trimmed.

But if I boot back to the 5.0 kernel and run fstrim it shows ~143G


Anybody have a clue what's going on?


Edit to add: I forgot to mention that I'm not running any version of raid, it's a single ssd.
_________________
Asus m5a99fx, FX 8320 - nouveau, oss4, rx550 for qemu passthrough
Acer laptop E5-575, i3-7100u - i965, alsa
---both---
5.0.13 zen kernel, profile 17.1 (no-pie & modified) amd64-no-multilib
gcc 8.2.0, eudev, openrc, openbox, palemoon


Last edited by Anon-E-moose on Wed Mar 18, 2020 12:46 pm; edited 2 times in total
Back to top
View user's profile Send private message
Goverp
l33t
l33t


Joined: 07 Mar 2007
Posts: 804

PostPosted: Wed Mar 18, 2020 10:35 am    Post subject: Reply with quote

This is possibly irrelevant, but I've noticed that gparted and kde partition manager both have problems calculating the size/free space of partioned raid volumes. I typically have 143 GB free of 5GB allocated! (It's actually something like 143GB of 750 GB) Not sure when it started as I haven't needed to repartition until I got a new box about a month ago, but I've been running kernel 5 series for some time.
_________________
Greybeard
Back to top
View user's profile Send private message
tholin
Apprentice
Apprentice


Joined: 04 Oct 2008
Posts: 181

PostPosted: Wed Mar 18, 2020 10:36 am    Post subject: Reply with quote

You are probably seeing the result of this new feature:
https://github.com/torvalds/linux/commit/a18f8775419d3df282dd83efdb51c5a64d092f31

- chunks that have been trimmed and unchanged since last mount are tracked and skipped on repeated trims
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4399
Location: Dallas area

PostPosted: Wed Mar 18, 2020 10:58 am    Post subject: Reply with quote

tholin wrote:
You are probably seeing the result of this new feature:
https://github.com/torvalds/linux/commit/a18f8775419d3df282dd83efdb51c5a64d092f31

- chunks that have been trimmed and unchanged since last mount are tracked and skipped on repeated trims


It could be the chunk thing.

But with this "feature" I'm not sure the trim is working the way it should.

I'll have to look and see if I can make the old behavior return.

Thanks for the link

Edit to add: Just did an emerge (one package and still on 5.5.9) then did a check with fstrim and it changed from ~143G before the emerge to ~2.3G after it.
Very screwy, and I don't like that behavior, as I'm not sure trimming is done right.

ETA2: I've marked this thread solved, though I'm unsure if there are really problems or just a change in how things are reported.

man fstrim says
Code:
       -v, --verbose
              Verbose execution.  With this option fstrim will output the number of bytes passed from the  filesystem
              down the block stack to the device for potential discard.  This number is a maximum discard amount from
              the storage device's perspective, because FITRIM ioctl called repeated will keep sending the same  sec‐
              tors for discard repeatedly.

              fstrim  will report the same potential discard bytes each time, but only sectors which had been written
              to between the discards would actually be discarded by the storage device.


Changing from (in my case) ~143G reported to ~2.3G reported doesn't mean much if the ~140G difference was never touched in the first place.
_________________
Asus m5a99fx, FX 8320 - nouveau, oss4, rx550 for qemu passthrough
Acer laptop E5-575, i3-7100u - i965, alsa
---both---
5.0.13 zen kernel, profile 17.1 (no-pie & modified) amd64-no-multilib
gcc 8.2.0, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum