Skip to content

perf(sysctl): add min_free_kbytes headroom to prevent gaming memory allocation stalls - #277

Open
drewano wants to merge 1 commit into
armada-os:mainfrom
drewano:feat/sysctl-gaming-memory-headroom
Open

perf(sysctl): add min_free_kbytes headroom to prevent gaming memory allocation stalls#277
drewano wants to merge 1 commit into
armada-os:mainfrom
drewano:feat/sysctl-gaming-memory-headroom

Conversation

@drewano

@drewano drewano commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Description

Configures vm.min_free_kbytes = 131072 (128 MB reserve headroom) in 60-armada-gaming.conf.

Context & Rationale

  • Under heavy 3D gaming memory pressure (e.g. Proton 11 / Wine games allocating large GPU/CPU heap buffers), the Linux virtual memory manager can experience direct page allocation stalls (kswapd wakeups / direct reclaim latency spikes) when free memory drops below the critical low watermark.
  • Adding a 128 MB (131072 kbytes) reserve headroom ensures the kernel always keeps sufficient clean free pages available for atomic and high-order memory allocations without latency spikes.
  • Complements the existing gaming sysctl optimizations (vm.watermark_boost_factor = 0 and vm.watermark_scale_factor = 125).

Changes

  • Added vm.min_free_kbytes=131072 to system_files/usr/lib/sysctl.d/60-armada-gaming.conf

Testing

  • Verified on AYN Odin 2 (Snapdragon 8 Gen 2 / SM8550) during heavy 3D gaming (Mortal Sin, Persona 5 Royal).

@justradical

Copy link
Copy Markdown
Member

Do you know if any other distros already set this value? Bazzite doesn't at least and you can encounter memory problems like this on 16gb devices as well

@justradical justradical self-assigned this Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants