Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Report: Experience with f2fs
Date: Tue, 24 Feb 2015 19:46:26
Message-Id: CAGfcS_nV2VbGtcomkvZ28Pj+zYtPLFjBDZ_d_GzS=juQ2QkOBw@mail.gmail.com
In Reply to: Re: [gentoo-user] Report: Experience with f2fs by Todd Goodman
1 On Tue, Feb 24, 2015 at 11:31 AM, Todd Goodman <tsg@×××××××××.net> wrote:
2 >
3 > But the device is still doing wear leveling and bad block
4 > replacement so you're beholden to those algorithms and what you think
5 > you're allocating as sequential blocks of the flash are not necessarily so.
6 >
7 > Of course any decent wear leveling algorithm is still going to work
8 > fine, but it seems to me like the wear leveling is still occuring in the
9 > device and the filesystem is beneficial for use on flash based devices
10 > for other reasons.
11 >
12
13 Sure, if the algorithm is brain-dead it can mess up the simple task
14 that f2fs hands it.
15
16 However, I don't think a good wear-leveling algorithm will do nearly
17 as good a job as something like f2fs. Suppose you have 10% of the
18 disk that gets heavily overwritten, and 90% that is fairly static.
19 The drive will have to detect that and decide when to move some of the
20 90% around just to allow that area to wear evenly. With f2fs every
21 block wears at the same rate by design. Sure, the wear-levelling
22 algorithm can look at that block with 500 erases and look for
23 someplace to relocate it, but it will find that all the other blocks
24 on the disk have either 500 or 501 erases and hopefully the algorithm
25 is smart enough to do nothing in that case.
26
27 The real killer for SSDs is writes to a unit of space smaller than an
28 erase block, because that requires copying and erasing. f2fs
29 completely eliminates that scenario, and I believe SSD-aware
30 filesystems like btrfs attempt to do this as well (since it doesn't
31 overwrite anything in-place).
32
33 Still, block reallocation at the device level shouldn't be a problem
34 as long as the device relocates entire erase blocks at a time so that
35 everything stays aligned, and I can't imagine why the designers of an
36 SSD would want to do reallocation at anything other than the erase
37 block level (or larger).
38
39 I'd be interested if somebody has more hands-on experience with how
40 these algorithms work together. Don't get me wrong - I agree that
41 ultimately the device has the final say in what data gets written
42 where. I just think that f2fs tends to promote data being written to
43 disk in a manner that makes things optimal for the firmware. If the
44 firmware authors assume that everything is FAT32 and that the first
45 10% of the disk needs to be moved around all the time regardless of
46 actual write patterns, then sure you're disk won't wear right and will
47 probably suffer performance-wise.
48
49 --
50 Rich