linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* SSD TRIM on balance
@ 2014-04-18 17:07 Sergey E. Kolesnikov
  2014-04-19  4:59 ` Duncan
  0 siblings, 1 reply; 2+ messages in thread
From: Sergey E. Kolesnikov @ 2014-04-18 17:07 UTC (permalink / raw)
  To: linux-btrfs

Greetings everyone.

I've recently rebalanced my btrfs (kernel 3.13) running on two SSD 
drives (raid-0) and a question arose.
Does btrfs perform TRIM on SSD balance? Fs is mounted with 'ssd' option, 
but not 'discard'.

It seems fstrim only trims free chunks in allocated space, so we 
possibly having a "trim leak" if no special treatment is taken on blocks 
reallocated during balance operation.

root@midnight:/mnt/tmp# fstrim -v /
/: 0 bytes were trimmed


root@midnight:/mnt/tmp# btrfs fi df /
Data, RAID0: total=90.00GiB, used=86.84GiB
System, RAID1: total=32.00MiB, used=12.00KiB
Metadata, RAID1: total=4.00GiB, used=2.56GiB


root@midnight:/mnt/tmp# btrfs fi show /
Label: ssdbtrfs  uuid: f61f749b-dce6-4e73-9d53-693e93ad61aa
     Total devices 2 FS bytes used 89.41GiB
     devid    1 size 111.31GiB used 49.03GiB path /dev/sda2
     devid    2 size 111.31GiB used 49.03GiB path /dev/sdb2

Btrfs v3.12


Best regards,
Sergey E. Kolesnikov

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: SSD TRIM on balance
  2014-04-18 17:07 SSD TRIM on balance Sergey E. Kolesnikov
@ 2014-04-19  4:59 ` Duncan
  0 siblings, 0 replies; 2+ messages in thread
From: Duncan @ 2014-04-19  4:59 UTC (permalink / raw)
  To: linux-btrfs

Sergey E. Kolesnikov posted on Fri, 18 Apr 2014 21:07:00 +0400 as
excerpted:

> I've recently rebalanced my btrfs (kernel 3.13) running on two SSD
> drives (raid-0) and a question arose.
> Does btrfs perform TRIM on SSD balance? Fs is mounted with 'ssd' option,
> but not 'discard'.
> 
> It seems fstrim only trims free chunks in allocated space, so we
> possibly having a "trim leak" if no special treatment is taken on blocks
> reallocated during balance operation.

As a user and list-regular, I don't know the answer to your question as 
I've not seen it come up before and don't recall seeing it covered on the 
wiki or the like either, but you have a very good point... and question.

FWIW I'm on dual-physical-device-SSDs here too (tho on btrfs raid1 mainly 
because I like having a second copy of everything to restore from in case 
the one copy goes bad and fails checksum) and also don't use the discard 
option.  While I'm currently running nearly 50% overprovisioned and thus 
the FTL has plenty of space to do its thing regardless of what I do with 
trim on the actually partitioned space, you raise a very good question 
indeed, one I wish I had thought to ask myself, and now that you have, 
one I'd very much like an answer to as well.

=:^)

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-04-19  4:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-18 17:07 SSD TRIM on balance Sergey E. Kolesnikov
2014-04-19  4:59 ` Duncan

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).