From ca8c91f589ba6099247b98e1656344c58372cbdf Mon Sep 17 00:00:00 2001 From: Douglas Teles Date: Sat, 18 Apr 2026 15:23:34 -0300 Subject: [PATCH] Fix Flycast and sysctl after deep research validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- .../packages/emulators/standalone/flycast-sa/package.mk | 6 +++++- .../packages/sysutils/systemd/config/sysctl.d/archr.conf | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/projects/ArchR/packages/emulators/standalone/flycast-sa/package.mk b/projects/ArchR/packages/emulators/standalone/flycast-sa/package.mk index 0aa80d7aeb..6d45f8d0b6 100644 --- a/projects/ArchR/packages/emulators/standalone/flycast-sa/package.mk +++ b/projects/ArchR/packages/emulators/standalone/flycast-sa/package.mk @@ -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() { diff --git a/projects/ArchR/packages/sysutils/systemd/config/sysctl.d/archr.conf b/projects/ArchR/packages/sysutils/systemd/config/sysctl.d/archr.conf index a46080c7df..2169da5069 100644 --- a/projects/ArchR/packages/sysutils/systemd/config/sysctl.d/archr.conf +++ b/projects/ArchR/packages/sysutils/systemd/config/sysctl.d/archr.conf @@ -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