Android sdcard storage solution (based on wrapfs File System)

Source: Internet
Author: User

Android sdcard storage solution (based on wrapfs File System)

 

The previous two articles mainly describe the fuse-based sdcard storage solution for android. For details, refer:

Android sdcard storage solution (based on fuse file system): One and

Android sdcard storage solution (based on fuse file system): II

These two articles mainly aim to illustrate the fuse-based sdcard storage principles and features.

At the same time, my previous article also introduced some knowledge about wrapfs file systems, but did not explain its usefulness. See:

Wrapfs: a stackable file system (a stack-based file system)

 

As the final article, we will mainly discuss the disadvantages of fuse-based sdcard storage solutions and the improvement of wrapfs-based android sdcard storage solutions.

I. disadvantages of fuse-based sdcard Storage Solutions

The default android solution is based on the user space file system, and the biggest advantage is good portability.

Http://en.wikipedia.org/wiki/Filesystem_in_Userspace

Analyze the default fuse solution operation process of android, for example. We can see that the biggest drawback is:

The fuse file system and sdcard dameon must frequently perform command interaction and data exchange,

Introduces kernel mode and user mode switching system overhead.

 

According to the analysis in the previous article, the data directory of the android user data space and the user sdcard directory are physically the same partition in emmc.

The file system also uses the same file system: ext4. For example:

 

Since the direct file system on the same partition/software of emmc on the hardware is ext4! So the question is coming!

Is there a reason we want the storage performance of the data directory to be close to that of the sdcard directory?

 

This issue is worth looking forward!

But is the result expected? See the test results:

Data DIRECTORY Based on ext4 Performance

Sdcard directory based on fuse + ext4 Performance

 

From the above test data, we can see that fuse performance is disappointing! This directly causes a high loss of storage performance!

Ii. Advantages of wrapfs-based sdcard Storage Solution

All of the above is for this section.

Since fuse has brought such great losses to the storage system, how can we improve it? Continue ......

The principles of the wrapfs-based android sdcard storage optimization solution are as follows:

 

As shown in the figure, wrapfs directly transmits requests from the upper layer to the underlying ext4 file system, which looks much simpler than fuse.
So the same problem is coming!

Is there any reason we want the storage performance of the data directory to be infinitely close to that of the sdcard directory?

See the test results:

Data DIRECTORY Based on ext4 Performance

 

Sdcard directory based on wrapfs + ext4 Performance

From the above test data, we can see that the storage performance based on wrapfs sdcard is infinitely close to ext4!

 

Summary:

Android is based on the fuse sdcard storage solution, which has high portability but poor performance. Especially for emmc with good performance, the performance drop is more obvious.

Based on the wrapfs sdcard storage solution, emmc has better performance and better performance. However, more human development and maintenance are required.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.