Is there any way to prevent Linux from ever swapping out anything but rather go right to the OOM killer if it runs out of physical RAM?
Background
I have a Linux workstation that every once in a while runs out of RAM. When this happens, it becomes unrecoverable. (This is true regardless of if swap is enabled or not, I've seen it happen both ways.)
What I want to happen in that case is to have the OOM killer start killing processes and keep doing so until the system recovers or crashes (either, or anything in between, is preferable to an indefinite hang). Interestingly, even with swap disabled this doesn't happen but rather the system gives indications it's swapping (stuff works, just orders of magnitude more slowly).
My current theory is that Linux is still swapping out data that it considers to be backed by disk, e.g. readonly pages from executables and mmap'ed files.
Note: I've already spend some effort and exhausted multiple techniques for limiting memory usage. I can't do much if any more of that without hindering normal operation. I really am looking for a "kill them all, and let the user sort it out" solution.