TIL that under memory pressure Linux will evict .text, and then thrash for a cou...

@filippo@abyssdomain.expert

TIL that under memory pressure Linux will evict .text, and then thrash for a couple minutes or more, reading it back thousands of times, before hitting the OOM killer. For 60MB of executable out of 8GB of memory (0.75%). That's objectively silly.

Tempted to make a package that mlock(MLOCK_ONFAULT)s the executable pages. Unfortunately systemd's default LimitMEMLOCK is 8MB.