From: Chris Mason <chris.mason@oracle.com>
To: Li Zefan <lizf@cn.fujitsu.com>
Cc: Martin Steigerwald <Martin@lichtvoll.de>, linux-btrfs@vger.kernel.org
Subject: Re: fstrim on BTRFS
Date: Tue, 3 Jan 2012 16:05:36 -0500 [thread overview]
Message-ID: <20120103210536.GJ6262@shiny> (raw)
In-Reply-To: <4EFBE668.7030800@cn.fujitsu.com>
On Thu, Dec 29, 2011 at 12:02:48PM +0800, Li Zefan wrote:
> Martin Steigerwald wrote:
> > Hi!
> >
> > With 3.2-rc4 (probably earlier), Ext4 seems to remember what areas it
> > trimmed:
> >
> > merkaba:~> fstrim -v /boot
> > /boot: 224657408 bytes were trimmed
> > merkaba:~> fstrim -v /boot
> > /boot: 0 bytes were trimmed
> >
> >
> > But BTRFS does not:
> >
> > merkaba:~> fstrim -v /
> > /: 4431613952 bytes were trimmed
> > merkaba:~> fstrim -v /
> > /: 4341846016 bytes were trimmed
> >
> >
> > Is it planned to add this feature to BTRFS as well?
> >
>
> There's no such plan, but it's do-able, and I can take care of it.
> There's an issue though.
>
> Whether we want to store TRIMMED information on disk? ext4 doesn't
> do this, so the first fstrim will be slow though you've done fstrim
> in previous mount.
I'd rather not store the trim status on disk. The extra trims
don't have a huge cost, and since some devices have a large granularity
for trims, they may ignore the trim until it tosses a larger contiguous
area of the disk.
I'd be fine with a flag to the in-memory free extent struct that
indicates if it has been trimmed down to the device.
-chris
next prev parent reply other threads:[~2012-01-03 21:05 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-28 16:57 fstrim on BTRFS Martin Steigerwald
2011-12-29 4:02 ` Li Zefan
2011-12-29 4:21 ` Fajar A. Nugraha
2011-12-29 4:32 ` Fajar A. Nugraha
2011-12-29 4:37 ` Roman Mamedov
2011-12-29 4:42 ` Fajar A. Nugraha
2011-12-29 5:29 ` cwillu
2011-12-29 10:52 ` Martin Steigerwald
2012-01-03 21:05 ` Chris Mason [this message]
2011-12-29 4:29 ` Fajar A. Nugraha
2011-12-29 9:39 ` Li Zefan
2011-12-29 9:52 ` Fajar A. Nugraha
2011-12-30 6:19 ` Li Zefan
2011-12-30 6:35 ` Fajar A. Nugraha
-- strict thread matches above, loose matches on Subject: below --
2014-10-31 0:21 Noah Massey
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=20120103210536.GJ6262@shiny \
--to=chris.mason@oracle.com \
--cc=Martin@lichtvoll.de \
--cc=linux-btrfs@vger.kernel.org \
--cc=lizf@cn.fujitsu.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;
as well as URLs for NNTP newsgroup(s).