SteamOS icon indicating copy to clipboard operation
SteamOS copied to clipboard

[Suggestion] I suggest SteamOS 3 to use F2FS with default compression

Open AtilaSaraiva opened this issue 2 years ago • 4 comments

The steam deck will come with limited amount of SSD storage, and the fastest file system for SSDs is F2FS, which also allows for transparent compression. This will allow a better use of storage space. I suggest this FS to come as default on SteamOS 3 for those reasons.

Thx for all the awesome things you're doing!

AtilaSaraiva avatar Jul 16 '21 17:07 AtilaSaraiva

I think is probably better to use btrfs + zstd that support SSD too.

Best Regards

liberodark avatar Jul 16 '21 22:07 liberodark

It would be fairly good too, even more so because it would support snapshotting. However, F2FS is faster on SSDs compared to BTRFS, and both support compression. Either way, I'd be completely satisfied with BTRFS.

Best.

AtilaSaraiva avatar Jul 17 '21 01:07 AtilaSaraiva

I think is probably better to use btrfs + zstd that support SSD too.

So I have a steam deck and it comes with 2 partitions, btrfs and ext4 with ext4 specifically being used for Steam games because of its casefold (i.e. case insensitivity) support which is necessary for Windows games. Afaik btrfs does not support casefold so its a non option for the storage of Steam games.

However I am not sure why Valve chose ext4 rather than f2fs. f2fs would have likely provided tangible improvements especially to load screen time in games, its extremely mature (has been used for Android devices for years) and it also comes with native casefold support (for those not aware f2fs was specifically designed for flash based storage devices, i.e. nvme/sd cards since its aware of the physical layout of NAND flash unlike more general purpose filesystems such as ext4 which also have to handle mechanical hard drives). f2fs also supports native compression although this would need some testing since compression/decompression uses additional CPU which may not be beneficial depending on the circumstance (i.e. game doing heavy IO while also using CPU to render graphic frames). I also wouldn't be surprised if f2fs ends up using less power as well (after all it was originally designed for phones by Samsung).

The only potential downside that I see is that in the case of unclean shutdown the chances of corruption (depending on what options you use to create the f2fs filesystem, i.e. if you use extra_attr,inode_checksum,sb_checksum) are higher BUT this is not so much of a concern for Steam games because Steam supports verifying a game which checks for any type of corruption. Exception here is save games but that is auto synced to steam cloud anyways.

I mean if it works out its also a major selling point of Steam Deck since you theoretically be able to load some games faster than even on Windows!

In any case I have created https://github.com/ValveSoftware/SteamOS/issues/777 which is just about compiling f2fs support into the shipped Steam Deck kernel. Changing the default filesystem installation for a steam deck would be a pain however at least with the option to use it tinkerer's can play around with it to see if there are any potential problems.

mdedetrich avatar May 04 '22 12:05 mdedetrich

There is quite some evidence - both on Windows and Linux - that compression rather accelerates the loading of most games. This is especially true for slower storage like SD cards, as it is clearly limited by the IO and not the CPU while decompression. There are community patches for the Steam Deck to allow, flash, mount and use btrfs/f2fs on SD cards. The results are quite promising and Valve should consider changing the default fs for SD cards to one of these.

Root-Core avatar Jul 21 '22 15:07 Root-Core

If the decision were made to use BTRFS ciopfs could be used to provide casefolding if needed.

I think using a filesystem with deduplication would be especially good for all those Proton prefixes that are mostly the same.

bjoern-tantau avatar Jan 15 '23 01:01 bjoern-tantau

https://www.phoronix.com/news/Linux-5.14-File-Systems Phoronix Linux 5.14 SSD Benchmarks With Btrfs vs. EXT4 vs. F2FS vs. XFS

shtirlic avatar Feb 09 '23 03:02 shtirlic