From: Ruediger Meier <sweet_f_a@gmx.de>
To: Karel Zak <kzak@redhat.com>
Cc: "Theodore Ts'o" <tytso@mit.edu>,
Markus Trippelsdorf <markus@trippelsdorf.de>,
util-linux@vger.kernel.org
Subject: Re: [PATCH] fstrim: add systemd units
Date: Thu, 10 Apr 2014 11:17:04 +0200 [thread overview]
Message-ID: <201404101117.05565.sweet_f_a@gmx.de> (raw)
In-Reply-To: <20140410080514.GA26252@x2.net.home>
On Thursday 10 April 2014, Karel Zak wrote:
> On Wed, Apr 09, 2014 at 02:39:54PM -0400, Theodore Ts'o wrote:
> > On Wed, Apr 09, 2014 at 05:55:57PM +0200, Markus Trippelsdorf wrote:
> > > > > The fixed interval is problematic. There are SSD devices out
> > > > > there that suffer (their flash cells die out faster) when
> > > > > they get trimmed too often. A good rule of thumb is to trim
> > > > > once you have written the same amount as you have free space
> > > > > on your device. Obviously, that interval varies for every
> > > > > user (e.g. it's one week in my case).
> > > >
> > > > Is "mount -o discard" instead of fstrim interval more or less
> > > > bad regarding lifetime?
> >
> > For those SSD's that have a problem, "mount -o discard" is a
> > disaster. Some turn into bricks, others will have a degraded flash
> > cells, many will cause extremely degraded performance for other
> > processes.
> >
> > What I usually tell people as far as who ask me for advice is that
> > once a week is usually sufficient, especially for most desktop and
> > server systems. If you are running an extreme workload which is
> > doing a huge number of random writes, then sure, running fstrim
> > more frequently, or even using "mount -o discard" might make a lot
> > more sense --- especially if you are using PCIe attached flash.
> > But in those cases, the system administrator might not want be
> > willing to tolerate the random latencies in performance that might
> > show up when fstrim is running (for pretty much all SATA and SAS
> > attached SSD's out there, they don't yet support queued trim, so
> > each trim command requires draining the NCQ queue, which is why
> > sending trim commands, whether via "mount -o discard" or via fstrim
> > will incur a performance penalty to whatever else might be trying
> > to use the disk at the time).
> >
> > I'll note BTW that even using "fstrim" could potentially brick an
> > especially inexpensive/trashy SSD, although the vendor for whose
> > drive had been most commonly accused of promulgating those to the
> > world is out of business (although there are probably plenty of
> > those SSD's still in use in various community distros' audiences.)
>
> Thanks for the advices.
>
> I have modified the systemd fstrim.timer (daily -> weekly) and added
> some notes to the man page.
Thanks, maybe we could add another minor change to "fstrim -a" itself.
If possible it would be IMO useful to skip bind mounts to avoid
trimming the same filesystem several times in a row like this:
$ grep "tmp" /etc/fstab
/dev/vg0/tmpdirs /mnt/tmpdirs ext4 acl,user_xattr 1 2
/mnt/tmpdirs/tmp /tmp none bind 0 0
/mnt/tmpdirs/var/tmp /var/tmp none bind 0 0
$ ./fstrim -av
/tmp: 392 KiB (401408 bytes) trimmed
/var/tmp: 0 B (0 bytes) trimmed
/mnt/tmpdirs: 0 B (0 bytes) trimmed
Skipping bind mounts should still trim all mounted filesytems.
cu,
Rudi
next prev parent reply other threads:[~2014-04-10 9:17 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-03 21:41 [PATCH] fstrim: add systemd units Thomas Bächler
2014-04-07 10:43 ` Karel Zak
2014-04-08 10:25 ` Ruediger Meier
2014-04-08 10:57 ` Thomas Bächler
2014-04-08 12:07 ` Ruediger Meier
2014-04-08 15:42 ` Dave Reisner
2014-04-08 17:12 ` Ruediger Meier
2014-04-09 7:52 ` Karel Zak
2014-04-09 10:07 ` Ruediger Meier
2014-04-09 11:02 ` Karel Zak
2014-04-09 12:12 ` Ruediger Meier
2014-04-09 12:49 ` Thomas Bächler
2014-04-09 15:16 ` Ruediger Meier
2014-04-09 15:24 ` Thomas Bächler
2014-04-09 15:44 ` Ruediger Meier
2014-04-09 14:02 ` Markus Trippelsdorf
2014-04-09 15:48 ` Ruediger Meier
2014-04-09 15:55 ` Markus Trippelsdorf
2014-04-09 18:39 ` Theodore Ts'o
2014-04-10 8:05 ` Karel Zak
2014-04-10 9:17 ` Ruediger Meier [this message]
2014-04-10 12:49 ` Karel Zak
2014-04-10 13:16 ` Ruediger Meier
2014-04-10 13:22 ` Ruediger Meier
2014-04-08 17:26 ` Karel Zak
2014-04-08 17:30 ` Thomas Bächler
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=201404101117.05565.sweet_f_a@gmx.de \
--to=sweet_f_a@gmx.de \
--cc=kzak@redhat.com \
--cc=markus@trippelsdorf.de \
--cc=tytso@mit.edu \
--cc=util-linux@vger.kernel.org \
/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.