Merge "init.rc: tune F2FS to be aligned to system settings" am: 99ba4b36e8 am: d2060b771d
am: e727f6612c
Change-Id: I7a6b250ebb79baf726de6f6493fc2f11262682c4
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 3ec65a8..75035d0 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -658,6 +658,12 @@
write /proc/sys/vm/dirty_expire_centisecs 200
write /proc/sys/vm/dirty_background_ratio 5
+ # F2FS tuning. Set cp_interval larger than dirty_expire_centisecs
+ # to avoid power consumption when system becomes mostly idle. Be careful
+ # to make it too large, since it may bring userdata loss, if they
+ # are not aware of using fsync()/sync() to prepare sudden power-cut.
+ write /sys/fs/f2fs/${dev.mnt.blk.data}/cp_interval 200
+
# Permissions for System Server and daemons.
chown radio system /sys/android_power/state
chown radio system /sys/android_power/request_state