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