readd cloud@ list
On Wed, Dec 18, 2019 at 5:32 AM Martin Kolman <mkolman(a)redhat.com> wrote:
>
> On Wed, 2019-12-18 at 13:11 +0100, Martin Pitt wrote:
> > Hello Chris,
> >
> > Chris Murphy [2019-12-17 22:23 -0700]:
> > > This desktop@ thread [1] about a slow device restored by enabling
> > > fstrim.service, got me thinking about enabling fstrim.timer [2] by
> > > default in Fedora Workstation. But I'm curious if it might be
> > > desirable in other Fedora Editions, and making it a system-wide
> > > change?
> >
> > This is a function/property of hardware, so it's IMO not desktop specific at
> > all. Servers suffer just as well from hard disks becoming slower.
> This will also trim thin LVs on thin pools (if any), right ?
Correct.
> So not just hardware, it can even make "software" storage layouts faster
> & potentially even avoid pool exhaustion in some cases. :)
Maybe. I'm not sure either way if someone would actually notice
performance improvements, but it wouldn't make them worse. And yes,
potentially avoid pool exhaustion, in particular in under provisioned
cases.
I forgot to mention: with qemu/kvm/libvirt VM's, the trim would not
get passed down to the backing storage due to default settings. The
discard mode "unmap" is supported with a SCSI disk using virtio SCSI
controller; I see some curious works/doesn't work with "plain" virtio
disk. But when it works, it does pass down to underlying thinp LV and
raw files. If anyone is doing raw file backups, or otherwise paying
for storage, it could save them some coins. And when it doesn't work,
literally nothing happens: the file doesn't get holes punched out, but
there's also no corruption (I test these things with a Btrfs scrub; it
will consistently always complain if a single metadata or data
checksum mismatches).
Anyway, it's an optimization. Pretty well tested elsewhere at this
point. And offhand not aware of any liabilities, but thought I'd ask
about it before writing up a system wide change proposal.
One thing I see in the Ubuntu fstrim.service unit file that I'm not
seeing in the Fedora fstrim.service unit file, is a conditional for
containers (line 4). I'm not sure where to ask about that. Maybe
upstream systemd?
$ cat /lib/systemd/system/fstrim.service
[Unit]
Description=Discard unused blocks on filesystems from /etc/fstab
Documentation=man:fstrim(8)
ConditionVirtualization=!container
[Service]
Type=oneshot
ExecStart=/sbin/fstrim --fstab --verbose --quiet
ProtectSystem=strict
ProtectHome=yes
PrivateDevices=no
PrivateNetwork=yes
PrivateUsers=no
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectControlGroups=yes
MemoryDenyWriteExecute=yes
SystemCallFilter=@default @file-system @basic-io @system-service
chris@chris-Standard-PC-Q35-ICH9-2009:~$
--
Chris Murphy