From f65df964c01cf37f7a61fe4773320390d37c107a Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim Date: Fri, 29 Mar 2019 09:16:51 -0700 Subject: [PATCH] init.rc: tune F2FS to be aligned to system settings Android sets /proc/sys/vm/dirty_expire_centisecs to 200, so f2fs doesn't need to do checkpoint in 60 seconds. Bug: 127511432 Change-Id: I2ba0623053d4480b82003eb1cca85ff03c61fc0f Signed-off-by: Jaegeuk Kim --- rootdir/init.rc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rootdir/init.rc b/rootdir/init.rc index f2e7a7cf6..478f744f9 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -648,6 +648,12 @@ on boot 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