6 ms·
> Your disk LED will be flashing incessantly (I'm not entirely sure why). The VM is basically paging all clean pages in and out constantly as their tasks becom
by blattimwind 7y ago
> Your disk LED will be flashing
incessantly (I'm not entirely sure why).
The VM is basically paging all clean pages in and out constantly as their tasks become runnable. A pretty standard case of thrashing.
- throwaway2048 7y agoThis is with swap disabled.
- blattimwind 7y agoSwap and paging are different concepts. The VM can page clean pages (mmap'd files, like most code your system is running) from disk in and out all day if it wants, in fact, when Linux is thrashing, that's exactly what it's doing.
- AnssiH 7y agoYou can think of all your executables and shared libraries on disk as a kind of read-only swap. If the system is low on memory, a page of program code may be dropped from RAM and re-fetched from disk when it is needed again, i.e. when that section of the code is being executed again. (this effect is not limited to program code, though)
- Iwan-Zotow 7y agoAnything mmaped and read-only (SO included) could be and would be ditched
- ploxiln 7y agoIt should have been clarified, because it is not obvious: The kernel can evict memory-mappings of executable files which are currently running. When they jump to a part of the executable that is no longer in memory, it can page that part back in from the executable file on disk. This is pretty cool. But when memory is very low, the kernel will evict practically all user-space executable mappings from memory, and will be reading back in and evicting back out executable file contents on practically every single context switch. It's just trying so hard to squeeze out some space to make its tasks fit in memory and complete successfully. I think this was the desired behavior of big-iron batch-processing in the 90s? Not sure why it has persisted so long. I'm a big fan of linux and this is my biggest pet-peeve.
- ajross 7y agoWhat's the other option, though? It gets a fault for a page somewhere, it needs memory, and it has none. You have to evict something. What's your choice if not swap or filesystem-backed pages? Systems have never operated well under true VM pressure. Not in the 90's, not now. When the working set goes beyond available memory performance falls off a cliff. And the report in the article doesn't seem to have a good comparison anyway. I mean, do we seriously believe that Windows or OS X can handle this condition (4G, no swap) better? I mean, swap is default for a reason.
- throwaway2048 7y agoI'd much rather have OOMkiller trigger than have my system sit completely unresponsive for huge chunks of time, while I slowly struggle to kill something.
- dahfizz 7y agoWhile this might add convenience when all you do is use a web browser, Linux is huge in the server space. Having the OS suddenly and somewhat unpredictability killing programs is absolutely not an option for most workloads.
- quazeekotl 7y agoI don't think having a system sit completely unresponsive to anything for a huge amount of time is exactly optimal either.
- _jal 7y agoAbsolutely, which is why configurable knobs are things that exist. I already have to mess with the OOMkiller on my servers; I'm fine with fiddling with knobs on my desktop box too. This is Linux, after all. Wasn't one of the constant talking points in the war over the Init System That Shall Not Be Named that Linux needs to scale from embedded to big iron?
- eikenberry 7y ago
- throwaway3627 7y agoThere's several situations that need to be addressed in every VMM: Cold pages - not being used Warm/normal pages - average use pages Hot pages - being used a lot 1. LRU/histogramming cold RO-code/RO-data pages to be paged out (dropped) or compressed when other pages are hotter and there's memory pressure. 2. Compressing or paging out to disk volatile RW-data when cold and other pages are hotter and there's memory pressure. 3. Pinning in memory (compressed and/or uncompressed) pages that are hot for performance reasons, unlocking them when they become less hot or others become hotter. 4. Having the ability (like on macOS) to signal applications that the system is under severe memory pressure (say "SIGMEM", "SIGLOWMEM" or "SIGOOM"), and to drop volatile data that can regenerated or is ephemeral.
- caf 7y agoIn this case the RW data (private dirty) can't be paged out even if cold because the OP is inadvisedly running without swap. This leaves the VM very few targets to drop.