Understanding what is F-Sync and the effects of it during a system crash

Darklouis

Senior Member
Jun 17, 2017
381
122
0
Davao City
What is F-Sync? What are the effects when disabling it?
According to Linux Programmer's Manual on http://man7.org/linux/man-pages/man2/fsync.2.html

fsync() transfers ("flushes") all modified in-core data of (i.e.,
modified buffer cache pages for) the file referred to by the file
descriptor fd to the disk device (or other permanent storage device)
so that all changed information can be retrieved even if the system
crashes or is rebooted.
This includes writing through or flushing a
disk cache if present. The call blocks until the device reports that
the transfer has completed.
So basically, this is the one who protecting the /data partition from corrupting during a system crash or unexpected system reboot.
I've just learned it during my lessons in my programming class and this is one of my reasons why my device:
  1. Can't Enable Mobile Data
  2. For some reason, my status bar can't be customized and can't pull down the other settings
  3. Magisk keeps stopping

In some kernels, F-sync is disabled by default. Disabling it has certain effects. While disabled, it can improve memory speed but increases risk of data loss during a system crash.

I tried to Enable it for a sec and doing some benchmarks, I can say that the Disabled one has the highest score (in read/write scores) than the Enabled one, it could theoretically improve loading speed time in apps but it is barely unnoticeable. So I recommend that you should enable it in case of system crashes.
Other devs should give warning about F-Sync like in Twisted Kernel (Thanks @Twisted Prime for the heads-up).
If you want to enable it, you could enable it then set it on boot so it will always stay enabled.
 
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone