All of lore.kernel.org
 help / color / mirror / Atom feed
* How about btrfs on Android phone?
@ 2022-10-31  6:45 hmsjwzb
  0 siblings, 0 replies; only message in thread
From: hmsjwzb @ 2022-10-31  6:45 UTC (permalink / raw)
  To: linux-btrfs; +Cc: Qu Wenruo, Chris Mason, Josef Bacik, David Sterba

Hi BTRFS developers,

Recently I was wondering is it possible to use btrfs as Android phone default filesystem.

[1] Some concept in this email.
    UFS: Universal Flash Storage
    UFS device: A kind of flash device which handle SCSI command
    UFS firmware: A kind of software handle the SCSI command and deliver result
    LBA: logical block address

[2] How does this idea come out ?
    We all have the exprience that the longer an Android device is used the slower it will be.
    I think it may have some relationship with fragmentation.
    
    In the UFS4.0 protocol, China Android phone vendor Xiaomi present a technology named FBO (File Based Optimization).
    The main idea of FBO is to map the discontinuous LBA to continuous physical address managed by UFS firmware.
    
    LBA:                | 1 | 2 |   | 4 | 5 |   | 7 | 8 |
    Physical address:   | 1 | 2 | 4 | 5 | 7 | 8 |   |   |
    
    As we can see from above, after the FBO, the three discontinuous LBA chunk are mapped into one continuous
    chunk in physical address by firmware. So the UFS firmware can merge this into one single read operation.

    We can see that fragmentation is a real issue for Android phone vendors.
    As for FBO, I believe this technology has some limitations. It may not allocate physical continuous physical
    address for all logical continuous data.
    
    So I believe defragmentation is important for Android phone filesystems. 
     
[3] What's the problem with current Android filesystem F2FS ?
    (a) The file mapping table in F2FS.
        In my opinion, the design of F2FS mapping table is came from MINIX. I think this direct, indirect mapping
        design is some kind of encourage fragementation.
        
    (b) Lack of new filesystem feature.
        I think some new features in btrfs is difficult to implement in F2FS filesystem. For example, lack of delay
        allocation may make the fragmentation status on device even worse. Maybe it is possible to implement some new
        features. But it will make the code complex and hard to debug.
        
[4] What make btrfs attractive to me ?
    (a) Online filesystem defragmentation
        I know the online filesystem defragmentation is not mature by now. But I believe it can be mature in the future.
        If an Android phone uses online filesystem defragmentation in the middle night, the user exprience may be improved
        the next day.
        
    (b) New features.
        New features like COW may help application to save storage space.
        Checksums on data and metadata.
        ...
        
[5] The performance between F2FS and btrfs on phone.
    I haven't test the performance between F2FS and btrfs on Android phone. But I think F2FS has advantages. Because it has
    many flash based optimizations.
    
    But I believe btrfs can do those optimizations too.
    
[6] Seeking Some advice if we start to do some researches on this aspect.
    (a) I want to know is there any issue I haven't taken into concern.
    (b) How to measure two filesystem performance both in short term and long term? Is there any existing tool or we need to
        develop some tools for it.
        
Thanks

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-31  6:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-31  6:45 How about btrfs on Android phone? hmsjwzb

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.