Software Gadgets Technology

Android Phone: Why the file system of your Android phone is more important than you think

Written by Andy Prosper

Imagine that we were to compare the two Android Phones – Google Pixel with the Lenovo Moto Z: they are two calls, there is no doubt, and each has its clear advantages: Google Assistant and the camera are strengths of Pixel, while Moto Z has that Interesting ability to expand your options with Moto Mods. Oops, we forgot something: the Moto Z kicks the Pixel in its file system.

File system? What is that about the file system? It is this software element that is particularly amenable for the internal storage of our smartphones to act up healthier or worse, specially longer term. Those amenable for Lenovo have done a great job here, as shown by a technical analysis that should serve as an example that this section is more relevant than it seems.

Storage as an Achilles heel

It’s what a user did on his blog about the performance of Android devices. According to his analysis, one of the sections that most determine the use of a smartphone – especially in the long term – is the file system used in the different partitions of Android devices, and specifically the speed with which the so-called deeds behave.

This type of operation allows to evaluate the behavior of a storage system, and media such as AnandTech revealed how the iPhone 7 barely managed 2.33 MB / s in this type of writings while the Google Pixel XL was around 3.35 MB / s in this section.

In those analyzes were already the differences between different devices: suddenly detected as a device as the Huawei Honor 8 far outnumbered the Pixel XL or the Galaxy S7 Edge in this section, and achieved 32.05 MB / s in the AndroBench test 5.0 for 4K random writes.

The importance of random 4K scripts

Why are these tests important? Well because although when you start using these devices everything goes smoothly and the fluidity is fantastic, the NAND memory on which the storage systems are based is degrading.

Having a better behavior in these deeds guarantees that in the long term our phone “will not become lentorro” (or at least not so much) for that continued use and degradation. How is it possible, when theoretically the hardware of the Honor 8 is more modest? The answer is not in the hardware, but in the software.

The analysis of this user revealed the causes of good behavior of a device such as Moto Z versus Google Pixel. In the performance graphs, the latency could be checked in relation to the percentage of completed input / output operations (p50 would be that 50% of the I / O operations are completed in an X time), and they quickly make clear how the things in this area.

In this graph the values p50, p90 and p99 are shown, and as the author of the analysis indicates, the median value of the Moto Z is 0.5 ms, while that of the Pixel is 3.3 ms, or what It is the same, almost seven times higher. Especially worrying is the latency in the p99 measurement, which was especially high. Ensuring that these operations were completed took more time than was desirable. And the problem, says the author, will worsen over time.

Learning to format Android partitions

The secret of the Moto Z is not as we said in its hardware components, but in the file systems used in the different system partitions of the device.

The comparisons between both devices made it clear that Lenovo had worked hard this section and had chosen very interesting options to format those partitions.

The first example is at the mount / storage / emulated / 0 point, which is the basis of the storage system. In the new devices, the differences between the internal flash storage (the capacity sold by the manufacturer) and the external one (a microSD card) have faded. In fact, when the manufacturer does not offer a microSD slot, the emulation of an external storage system continues to be provided so that compatibility with old applications that “search” for that storage system can be enabled.

In the Pixel that mount point is mounted with the file system fuse, a “bad option” because it consumes more CPU and delays I / O operations by 30%. In the Moto Z we find the esdfs file system, which behaves better both in efficiency and speed and which is a file system derived from Wrapfs, a “stackable” SF.

The secret is in F2FS

Even more interesting is the file system used in the / data partition, which in Google Pixel is formatted with the traditional ext4, very popular in Linux distributions. Instead, Moto2 uses f2fs, a new file system developed by Samsung that simplifies writing operations, and actually needs 50% less of them than ext4. According to the author, f2fs allows the Moto Z to have a performance 2 times higher and twice the life of the NAND memory compared to the Pixel. Or put another way: your Moto Z will age much better than Google Pixel.

The use of this file system is also done with special parameters such as nobarrier, an option already available in the XFS file system created by Silicon Graphics for its workstations in the 90s. The idea is to implement a caching solution in RAM to accelerate all those scripts, and this parameter helps this partition behave even better, especially in the long term.

Eye, because these advantages do not occur in all scenarios (in fact, if we leave the world of mobile ext4 is still fantastic to format our SSDs), but it seems clear that at least in the field of NAND memories used in smartphones These tests show that this type of option gives many interesting advantages.

Why is not it in more devices?

In view of these results, it seems clear that F2FS is more interesting than the traditional EXT4 at the time of being used as a file system in our phones. Which is the reason?

Apparently, the Android developers themselves are paying attention to F2FS, but have found some drawbacks to this alternative. As explained in an AMA of Reddit Tim Murray, one of the responsible for Android, “we are studying it”.

However, Murray also explained that “right now it is not really suitable for a high-end device due to the lack of support for native hardware encryption.” A device that allows encryption of the file system has a better alternative in EXT4 or that hardware encryption block. dedicated “, not as it happens with F2FS that imposes an additional load on the CPU to perform that encryption of the filesystem. Even so, confessed this engineer “we will continue experimenting with him”.

So, we’d better pay attention to the file systems chosen by the manufacturers for their devices: it depends on them that these smartphones begin to behave worse, with response times and fluidity significantly worse than when we bought them and started using them.

About the author

Andy Prosper