public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Understanding fstrim...
@ 2020-04-13  5:32 tuxic
  2020-04-13  9:22 ` Andrea Conti
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: tuxic @ 2020-04-13  5:32 UTC (permalink / raw
  To: Gentoo

Hi,

From the list I already have learned, that most of my concerns regarding
the lifetime and maintainance to prolong it are without a
reason.

Nonetheless I am interested in the technique as such.

My SSD (NVme/M2) is ext4 formatted and I found articles on the
internet, that it is neither a good idea to activate the "discard"
option at mount time nor to do a fstrim either at each file deletion
no triggered by a cron job.

Since there seems to be a "not so good point in time", when to do a
fstrim, I think there must also be a point in time, when it is quite
right to fstrim the mu SSD.

fstrim clears blocks, which currently are not in use and which
contents is != 0.

The more unused blocks there are, which has a contents != 0, the
lesser the count of blocks is, which the wear leveling algorithm can
use for its purpose.

That leads to the conclusion: to fstrim as often as possible, to keep the
count of empty blocks as high as possible.

BUT: Clearing blocks is an action, which includes writes to the cells of
the SSD.

Which is not that nice.

Then, do a fstrim just in the moment, when there is no useable block
left.

Then the wear-leveling algorithm is already at its limits.

Which is not that nice either.

The truth - as so often - is somewhere in between.  

Is it possible to get an information from the SSD, how many blocks are
in the state of "has contents" and "is unused" and how many blocks are
in the state of "has *no* contents" and "is unused"?

Assuming this information is available: Is it possible to find the
sweat spot, when to fstrim SSD?

Cheers!
Meino





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

end of thread, other threads:[~2020-04-14 14:51 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-13  5:32 [gentoo-user] Understanding fstrim tuxic
2020-04-13  9:22 ` Andrea Conti
2020-04-13  9:49   ` Neil Bothwick
2020-04-13 11:01     ` Andrea Conti
2020-04-13 10:06 ` Michael
2020-04-13 11:00   ` tuxic
2020-04-13 14:00     ` David Haller
2020-04-13 10:11 ` Peter Humphrey
2020-04-13 11:39 ` Rich Freeman
2020-04-13 11:55   ` Michael
2020-04-13 12:18     ` Rich Freeman
2020-04-13 13:18       ` tuxic
2020-04-13 14:27         ` Rich Freeman
2020-04-13 15:41           ` David Haller
2020-04-13 16:05             ` Rich Freeman
2020-04-13 20:34               ` antlists
2020-04-13 20:58                 ` Rich Freeman
2020-04-14  3:32                   ` tuxic
2020-04-14 12:51                     ` Rich Freeman
2020-04-14 14:26                       ` Wols Lists
2020-04-14 14:51                         ` Rich Freeman
2020-04-13 15:48     ` [gentoo-user] " Holger Hoffstätte

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox