It's good that we have better swapping now, but I wish they'd address the above. I'd rather have programs getting OOMKilled or throwing errors before the system grinds to a halt, where I can't even ssh in and run 'ps'.
It's good that we have better swapping now, but I wish they'd address the above. I'd rather have programs getting OOMKilled or throwing errors before the system grinds to a halt, where I can't even ssh in and run 'ps'.
An interactive system that does not interact (terminal not reactive, can't ssh in, screen does not refresh) is broken. I don't understand why this is not a kernel bug.
On my system, to add insult to injury, when the system does come back twenty minutes later, I get a "helpful" pop-up from the Linux Kernel saying "Memory Shortage Avoided". Which is just plain wrong. The pop-up should say "sorry, the kernel bricked your system for a solid twenty minutes for no good reason, please file a report".
If the machine is swap trashing, all i/o goes to the same congested queue. .bash_history read or write access, memory allocation, stuff your terminal program does, stuff your wayland compositor or X11 stack does, bash accessing data in its memory that has been swapped out, etc etc. And each of those could be waiting for a while to issue their IO request since the IO system is flooded by swap IO.
There should be a tool that can show the interdependent graph of pending, blocking io operations.
Or Alt+[SysRq,h] for help
In 30 years of using desktop Linux I've never been able to interrupt a swapstorm. The only way out is long-press the power button.
On your system it probably doesn't work at all, not even when idle. It can only be 3 reasons:
- Your kernel doesn't have it. You probably have a generic kernel provided by the package manager without this feature enabled. I can't really help you here. I always build my own kernel from source (+ patches).
- Something hijacks your keyboard input. If you have a console already opened and logged in as root, you can "echo f > /proc/sysrq-trigger". Else, you can try setting up a permanent serial console and send the command from another computer. CTRL+2 then the command letter (f). The magic sysrq key over serial console is a separate kernel option that needs to be enabled.
- You're doing it wrong. On laptop keyboards, keyboards less than 104/105 keys, sysrq is one of the first keys to be removed. Getting it pressed with Fn combinations... Good luck with that!That'd require some new capabilities added, and some substantial shifts in how distro maintainers & users operate, so it's extremely unlikely. It's much closer to how things like Android operate, though still not quite as secure as giving each application its own user & dedicated storage for data.
echo y >/sys/kernel/mm/lru_gen/enabledAny combination of cgroups, /proc flags and other forbidden knobs to get such behaviour?
And searching desperately for "just kill the damn thing" option.