From 8487da900e65ccdec06d7f9bacb0813702ee621b Mon Sep 17 00:00:00 2001 From: minaripenguin Date: Thu, 11 Dec 2025 06:34:55 +0700 Subject: [PATCH] S666LN: init: Tune F2FS and dirty writeout policy for modern devices In a previous commit bb0838b5114419b4f8ecff67c0b6fb728399c7b7, the gc_urgent_sleep_time for F2FS was aggressively set to 50ms to optimize GC. This change, however, led to performance regressions on most devices, particularly of those running in 4.19+ kernels. From our tests, the heightened CPU and I/O activity from this aggressive garbage collection setting is the likely cause. To address this, we're revising the gc_urgent_sleep_time parameter to strike a balance between aggressive GC and device performance, taking bb0838b5114419b4f8ecff67c0b6fb728399c7b7 goal into consideration. Furthermore, the dirty writeout policy has been aligned with the latest configurations used in Pixel devices, and cp_interval has been adjusted to surpass dirty_expire_centisecs for improved power efficiency during idle times. [ChrisCatto]: Do not set dirty_background_ratio to 10 because that is the default value for us anyways. Test: booted partner device, monitor performance Change-Id: Ie4d0c870d734e915aaebcc53e64acdabac47b6dc Signed-off-by: minaripenguin Signed-off-by: KimelaZX --- rootdir/etc/init/hw/init.mt6789.power.rc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rootdir/etc/init/hw/init.mt6789.power.rc b/rootdir/etc/init/hw/init.mt6789.power.rc index c600b5c..3d5ec30 100644 --- a/rootdir/etc/init/hw/init.mt6789.power.rc +++ b/rootdir/etc/init/hw/init.mt6789.power.rc @@ -71,6 +71,8 @@ on post-fs-data write /sys/block/sdb/queue/iostats 0 write /sys/block/sdc/queue/iostats 0 write /sys/block/sdc/queue/nr_requests 256 + write /dev/sys/fs/by-name/userdata/cp_interval 6000 + write /dev/sys/fs/by-name/userdata/gc_urgent_sleep_time 200 on boot # boot perf. tune