Gentoo Archives: gentoo-user

From: tuxic@××××××.de
To: Gentoo <gentoo-user@l.g.o>
Subject: [gentoo-user] Understanding fstrim...
Date: Mon, 13 Apr 2020 05:32:47
Message-Id: 20200413053237.mvh5lvejmj67nkpe@solfire
1 Hi,
2
3 From the list I already have learned, that most of my concerns regarding
4 the lifetime and maintainance to prolong it are without a
5 reason.
6
7 Nonetheless I am interested in the technique as such.
8
9 My SSD (NVme/M2) is ext4 formatted and I found articles on the
10 internet, that it is neither a good idea to activate the "discard"
11 option at mount time nor to do a fstrim either at each file deletion
12 no triggered by a cron job.
13
14 Since there seems to be a "not so good point in time", when to do a
15 fstrim, I think there must also be a point in time, when it is quite
16 right to fstrim the mu SSD.
17
18 fstrim clears blocks, which currently are not in use and which
19 contents is != 0.
20
21 The more unused blocks there are, which has a contents != 0, the
22 lesser the count of blocks is, which the wear leveling algorithm can
23 use for its purpose.
24
25 That leads to the conclusion: to fstrim as often as possible, to keep the
26 count of empty blocks as high as possible.
27
28 BUT: Clearing blocks is an action, which includes writes to the cells of
29 the SSD.
30
31 Which is not that nice.
32
33 Then, do a fstrim just in the moment, when there is no useable block
34 left.
35
36 Then the wear-leveling algorithm is already at its limits.
37
38 Which is not that nice either.
39
40 The truth - as so often - is somewhere in between.
41
42 Is it possible to get an information from the SSD, how many blocks are
43 in the state of "has contents" and "is unused" and how many blocks are
44 in the state of "has *no* contents" and "is unused"?
45
46 Assuming this information is available: Is it possible to find the
47 sweat spot, when to fstrim SSD?
48
49 Cheers!
50 Meino

Replies

Subject Author
Re: [gentoo-user] Understanding fstrim... Andrea Conti <alyf@××××.net>
Re: [gentoo-user] Understanding fstrim... Michael <confabulate@××××××××.com>
Re: [gentoo-user] Understanding fstrim... Peter Humphrey <peter@××××××××××××.uk>
Re: [gentoo-user] Understanding fstrim... Rich Freeman <rich0@g.o>