Bug 244692 - gjournal: Does not support TRIM
Summary: gjournal: Does not support TRIM
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.1-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-fs (Nobody)
URL:
Keywords: feature, needs-patch
Depends on:
Blocks:
 
Reported: 2020-03-09 10:47 UTC by Paul
Modified: 2020-03-09 11:21 UTC (History)
1 user (show)

See Also:
koobs: mfc-stable12?
koobs: mfc-stable11?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul 2020-03-09 10:47:33 UTC
# gjournal load
# gjournal label -vh /dev/gpt/testdata /dev/gpt/testlog
# newfs -J -t -g 1M /dev/gpt/testdata.journal
# mount -o "async,atime=off" /dev/gpt/testdata.journal /mnt 
# tail -n 3 /var/log/messages
Mar  9 12:22:16 ctl kernel: GEOM_JOURNAL: BIO_FLUSH not supported by gpt/testlog.
Mar  9 12:22:16 ctl kernel: GEOM_JOURNAL: BIO_FLUSH not supported by gpt/testdata.
Mar  9 12:25:40 ctl kernel: WARNING: /mnt: TRIM flag on fs but disk does not confirm that it supports TRIM

# smartctl -a /dev/nvme1 | grep -i utiliz
Namespace 1 Utilization:            50,589,696 [50.5 MB]
# dd if=/dev/random of=/mnt/junk bs=1m count=30000
# smartctl -a /dev/nvme1 | grep -i utiliz
Namespace 1 Utilization:            36,860,428,288 [36.8 GB]
# rm /mnt/junk
… after a couple of time still not free …
# smartctl -a /dev/nvme1 | grep -i utiliz
Namespace 1 Utilization:            36,860,428,288 [36.8 GB]

It seems, gjournal still does not support TRIM in 2020?!.. neither for data device nor for journal device.

And really, one more fast proof:
# trim -f /dev/gpt/testdata.journal
trim /dev/gpt/testdata.journal offset 0 length 53687090688
trim: /dev/gpt/testdata.journal: TRIM/UNMAP not supported by driver


Without gjournal trim works fine on the same device nvd1.
# gjournal stop /dev/gpt/testdata
# trim -f /dev/nvd1
trim /dev/nvd1 offset 0 length 960197124096
# smartctl -a /dev/nvme1 | grep -i utiliz
Namespace 1 Utilization:            0