Files
Jaegeuk Kim 8455745b37 sdm710-common: rootdir: f2fs use fsync_mode=nobarrier options
from: device_google_bonito commit e02e4813256e51bacdecb
- fstab: use fsync_mode=nobarrier

  This patch proposes to skip FLUSH commands for UFS when fsync(2) for non-atomic
  files is called.

  == Pros ==
   - huge gain on random write/fsync test from 30MB/s to 90MB/s
     (e.g., Androbench)
   - extented flash lifetime
     (FLUSH command requires for FTL to write its metadata)

  == Cons ==
  In terms of stability,
  1) checkpoint issues FLUSH, so this doesn't hurt F2FS consistency.
  2) atomic write issues FLUSH, so SQLite w/ journal mode would be safe.
  3) non-atomic fsync() doesn't issue FLUSH, so there is one scenario to consider
  where:
     a. fsync() flushes data blocks to disk, and then node blocks. The last node
        block contains a flag as the candidate for roll-forward recovery.
     b. assuming that storage is able to flush disk cache in out-of-order manner,
        all the cached node blocks are written to the flash cell, followed by all
        the data blocks.
     c. cut power
     d. F2FS conducts roll-back to the last checkpoint w/o risk. Then, it starts
        roll-forward recovery which traverses the node block chain and finds node
        blocks written by b. lastly.
     e. After mount, user can see old or zero data from the recovered node blocks.

  Three points persuaded me to go with this:
  1) In the above scenario, it won't hurt filesystem consistency.
  2) Generally, firmware in embedded UFS/eMMC doesn't do out-of-order writes,
     since it doesn't have large cache to reorder write IOs likewise SSDs.
  3) It'd be okay to lose the last-called fsync() due to power-cut, since users
     won't be aware of it mostly.

Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I6d0fee62c081d55b462371412f390861f5f73a68
2023-09-12 18:49:54 +00:00

32 lines
3.6 KiB
Plaintext

# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
#TODO: Add 'check' as fs_mgr_flags with data partition.
# Currently we dont have e2fsck compiled. So fs check would failed.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
/dev/block/bootdevice/by-name/boot /boot emmc defaults defaults
/dev/block/bootdevice/by-name/recovery /recovery emmc defaults defaults
/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
system /system ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount,avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-gsi.avbpubkey
system_ext /system_ext ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount
product /product ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount
vendor /vendor ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount
odm /odm ext4 ro,barrier=1,discard wait,avb,logical,first_stage_mount
/dev/block/bootdevice/by-name/cache /cache ext4 nosuid,noatime,nodev,barrier=1 wait
/dev/block/by-name/logdump /metadata ext4 noatime,nosuid,nodev,discard wait,check,formattable,first_stage_mount
/dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,noatime,nodev,lazytime,fsync_mode=nobarrier latemount,wait,check,formattable,fileencryption=::v1,quota,reservedsize=128M
/dev/block/bootdevice/by-name/userdata /data ext4 noatime,nosuid,noatime,nodev,barrier=1,noauto_da_alloc,lazytime latemount,wait,check,formattable,fileencryption=::v1,quota,reservedsize=128M
/dev/block/bootdevice/by-name/bluetooth /vendor/bt_firmware vfat ro,shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 wait
/dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,nosuid,nodev,barrier=1 wait
/dev/block/bootdevice/by-name/modem /vendor/firmware_mnt vfat ro,shortname=lower,uid=0,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait
/dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 nosuid,noatime,nodev,barrier=1 wait,check
/devices/platform/soc/8804000.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto
/devices/platform/soc/a600000.ssusb/a600000.dwc3/xhci-hcd.*.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto