public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ted Ts'o" <tytso@mit.edu>
To: Vincent Pelletier <plr.vincent@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: ext4 bug ? "Intel 320 SSD write performance – contd."
Date: Mon, 31 Oct 2011 17:09:51 -0400	[thread overview]
Message-ID: <20111031210951.GK16825@thunk.org> (raw)
In-Reply-To: <CAF78GY1_HwP2QZsMLqHeJechjps44Jq2o1VDSFC0TriXB1riPQ@mail.gmail.com>

On Mon, Oct 31, 2011 at 09:38:37PM +0100, Vincent Pelletier wrote:
> 
> Reading this blog post[1], I thought the "2nd iteration" results could be
> considered a bug in mkfs.ext4 (and possibly any mkfs implementation):
> shouldn't mkfs run [FI]TRIM on its target before creating filesystem
> structure ?

It's not enabled by default, because there are crappy SSD's out there
where use of the TRIM command will turn them into bricks.  (No, it's
not the Intel X-25 drives that I'm worried about.)

So I (and the distributions) don't want to make it the default, since
if you buy crap drives and then mke2fs turns them into bricks, who are
you likely to blame?  The crap SSD manufacturer?  Yourself for trying
to buy SSD's on the cheap?  Or the program that issued the TRIM
command?

You can enable the trim behaviour by default by adding to your
/etc/mke2fs.conf file:

[defaults]
	discard = true

But then it's on your head if anything bad happens.  :-/

        	      	      	      - Ted

P.S.  For a similar reason we don't enable TRIM commands in the
kernel, where we have three possible ways of issuing TRIM.  One is
continuously, as files get unlinked (and the file system transaction
is committed).  Another way is via a userspace progam run out of cron
which calls the FITRIM ioctl; and the third way is at e2fsck time,
after a full e2fsck run without any file system errors detected.
Depending how the SSD implemented TRIM, (and of course your workload),
some of these methods can be performance disasters, and have resulted
in SSD's getting bricked, which is again why none of these are turned
on by default.


  reply	other threads:[~2011-10-31 21:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-31 20:38 ext4 bug ? "Intel 320 SSD write performance – contd." Vincent Pelletier
2011-10-31 21:09 ` Ted Ts'o [this message]
2011-10-31 21:47   ` Vincent Pelletier
2011-11-01 13:34   ` Stephen Clark
2011-11-01 13:41     ` Theodore Tso
2011-11-01 14:00       ` Stephen Clark
2012-01-15 18:37   ` ext4 bug ? "Intel 320 SSD write performance ??? contd." Pavel Machek

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=20111031210951.GK16825@thunk.org \
    --to=tytso@mit.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=plr.vincent@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox