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.

Bug: 34123235
Change-Id: Ieb163de5136a621d379dd5bcd762b4307b8dd46f
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
1 file changed
tree: 9eaaf0bcda19d3287e01159062c6e2f7fe5b4137
  1. acdbdata/
  2. audio/
  3. blueline/
  4. bluetooth/
  5. crosshatch/
  6. dumpstate/
  7. factory-images_blueline/
  8. factory-images_crosshatch/
  9. gpt-utils/
  10. health/
  11. hidl/
  12. json-c/
  13. nfc/
  14. overlay/
  15. permissions/
  16. power-libperfmgr/
  17. recovery/
  18. sdm845/
  19. seccomp_policy/
  20. self-extractors/
  21. self-extractors_blueline/
  22. sensors/
  23. sepolicy/
  24. thermal/
  25. usb/
  26. vibrator/
  27. voice_processing/
  28. vr/
  29. .clang-format
  30. .gitignore
  31. Android.mk
  32. AndroidProducts.mk
  33. aosp_blueline.mk
  34. aosp_crosshatch.mk
  35. audio_effects.xml
  36. audio_platform_info_tavil_b1.xml
  37. audio_platform_info_tavil_c1.xml
  38. audio_policy_configuration.xml
  39. audio_policy_configuration_a2dp_offload_disabled.xml
  40. audio_policy_volumes.xml
  41. board-info.txt
  42. BoardConfig-common.mk
  43. CleanSpec.mk
  44. compatibility_matrix.xml
  45. config.fs
  46. default-permissions.xml
  47. device-blueline.mk
  48. device-common.mk
  49. device-crosshatch.mk
  50. device.mk
  51. device_framework_matrix.xml
  52. framework_manifest.xml
  53. fstab.hardware
  54. gps.conf
  55. gps_debug.conf
  56. graphite_ipc_platform_info.xml
  57. init.common.rc
  58. init.edge_sense.sh
  59. init.hardware.chamber.rc.userdebug
  60. init.hardware.diag.rc.user
  61. init.hardware.diag.rc.userdebug
  62. init.hardware.mpssrfs.rc.user
  63. init.hardware.mpssrfs.rc.userdebug
  64. init.hardware.rc
  65. init.hardware.usb.rc
  66. init.insmod.cfg
  67. init.insmod.sh
  68. init.logging.rc
  69. init.power.rc
  70. init.qcom.devstart.sh
  71. init.qcom.ipastart.sh
  72. init.qcom.wlan.sh
  73. init.radio.sh
  74. init.recovery.hardware.device.rc
  75. init.recovery.hardware.rc
  76. lowi.conf
  77. manifest.xml
  78. media_codecs.xml
  79. media_codecs_c2.xml
  80. media_codecs_google_audio.xml
  81. media_codecs_performance.xml
  82. media_profiles_V1_0.xml
  83. mixer_paths_tavil_b1.xml
  84. p2p_supplicant_overlay.conf
  85. powerhint.json
  86. preloads_copy.sh
  87. recovery.wipe
  88. sec_config
  89. sound_trigger_mixer_paths_wcd9340.xml
  90. sound_trigger_platform_info.xml
  91. system.prop
  92. thermal-engine-blueline-vr.conf
  93. thermal-engine-blueline.conf
  94. thermal-engine-crosshatch-vr.conf
  95. thermal-engine-crosshatch.conf
  96. ueventd.hardware.rc
  97. uinput-fpc.idc
  98. uinput-fpc.kl
  99. utils.mk
  100. vendorsetup.sh
  101. WCNSS_qcom_cfg.ini
  102. wifi_concurrency_cfg.txt
  103. wpa_supplicant_overlay.conf
  104. wpa_supplicant_wcn.conf