Fix Flycast and sysctl after deep research validation

Flycast-SA:
- Restore -Ofast sed (was incorrectly replaced with CMAKE_BUILD_TYPE=Release)
- -Ofast = -O3 + -ffast-math is INTENTIONAL for Flycast: the Dreamcast SH4
  FPU doesn't use strict IEEE 754, and the hardware itself flushes denormals
- Validated by JELOS/AmberELEC/ROCKNIX upstream for years without issues
- On weak Cortex-A35, the extra optimization from -ffast-math is meaningful

Sysctl:
- vm.dirty_writeback_centisecs: 500→1500 (match ROCKNIX, reduce I/O wakeups
  during gaming — read-heavy workload needs fewer writeback checks)
- vm.vfs_cache_pressure: 50→100 (restore kernel default — during gameplay
  the same few files are reread (ROM, save, shader cache), so a large
  inode/dentry cache provides no benefit on 1GB RAM. 50 is a desktop tuning
  that favors metadata cache for build/compile workloads, not gaming.
  Note: 200+ is what aggressively reclaims metadata; 100 is the neutral
  kernel default, not an override.)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Douglas Teles
2026-04-18 15:23:34 -03:00
parent b0d73b4c1e
commit ca8c91f589
2 changed files with 7 additions and 3 deletions
@@ -32,7 +32,11 @@ fi
pre_configure_target() {
export CXXFLAGS="${CXXFLAGS} -Wno-error=array-bounds"
PKG_CMAKE_OPTS_TARGET+=" -DCMAKE_BUILD_TYPE=Release -DUSE_OPENMP=ON"
PKG_CMAKE_OPTS_TARGET+=" -DUSE_OPENMP=ON"
# -Ofast is intentional for Flycast: SH4 FPU emulation doesn't require
# strict IEEE 754, and Dreamcast hardware itself flushes denormals.
# Validated by JELOS/AmberELEC/ROCKNIX upstream for years.
sed -i 's/\-O[23]/-Ofast/' ${PKG_BUILD}/CMakeLists.txt
}
makeinstall_target() {
@@ -1,9 +1,9 @@
kernel.nmi_watchdog=0
vm.swappiness=1
vm.laptop_mode=0
vm.dirty_writeback_centisecs=500
vm.dirty_writeback_centisecs=1500
vm.dirty_expire_centisecs=3000
vm.vfs_cache_pressure=50
vm.vfs_cache_pressure=100
vm.dirty_ratio=10
vm.dirty_background_ratio=5
vm.page-cluster=0