Gentoo Archives: gentoo-user

From: Todd Goodman <tsg@×××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Report: Experience with f2fs
Date: Tue, 24 Feb 2015 16:31:22
Message-Id: 20150224163113.GP8473@ns1.bonedaddy.net
In Reply to: Re: [gentoo-user] Report: Experience with f2fs by Rich Freeman
1 * Rich Freeman <rich0@g.o> [150224 10:19]:
2 > On Tue, Feb 24, 2015 at 8:11 AM, Todd Goodman <tsg@×××××××××.net> wrote:
3 > >
4 > > Can you explain why a log-based filesystem like f2fs would have any
5 > > impact on wear leveling?
6 > >
7 > > As I understand it, wear leveling (and bad block replacement) occurs on
8 > > the SSD itself (in the Flash Translation Layer probably.)
9 > >
10 >
11 > Well, if the device has a really dumb firmware there is nothing you
12 > can do to prevent it from wearing itself out. However, log-based
13 > filesystems and f2fs in particular are designed to make this very
14 > unlikely in practice.
15 >
16 > Log-based filesystems never overwrite data in place. Instead all
17 > changes are appended into empty space, until a large region of the
18 > disk is full. Then the filesystem:
19 > 1. Allocates a new unused contiguous region of the disk (which was
20 > already trimmed). This would be aligned to the erase block size on
21 > the underlying SSD.
22 > 2. Copies all data that is still in use from the oldest allocated
23 > region of the disk to the new region.
24 > 3. Trims the entire old region, which was aligned to the erase block
25 > size when it was originally allocated.
26 >
27 > So, the entire space of the disk is written to sequentially, and the
28 > head basically eats the tail. Every block on the drive gets written
29 > to once before the first block on the drive gets written to twice.
30 [..SNIP..]
31
32 Thanks for the info.
33
34 But the device is still doing wear leveling and bad block
35 replacement so you're beholden to those algorithms and what you think
36 you're allocating as sequential blocks of the flash are not necessarily so.
37
38 Of course any decent wear leveling algorithm is still going to work
39 fine, but it seems to me like the wear leveling is still occuring in the
40 device and the filesystem is beneficial for use on flash based devices
41 for other reasons.
42
43 I'm sure I'm still missing something though.
44
45 Thanks,
46
47 Todd

Replies

Subject Author
Re: [gentoo-user] Report: Experience with f2fs Rich Freeman <rich0@g.o>