Does it actually work?
Does it actually work?
Posted Apr 11, 2025 10:16 UTC (Fri) by Wol (subscriber, #4433)In reply to: Does it actually work? by intelfx
Parent article: Three ways to rework the swap subsystem
> Because you are (either accidentally or deliberately) conflating swap performance and memory management strategy.
And I may well be out of date, but people seem to be conflating swapping and paging. Am I right, in that a *swap* system *swaps processes* in and out of memory. While a *paging* system *swaps pages* in and out of memory. Which is why systems that page don't become as slow as systems that swap.
So a swapping system, faced with a large executable, will pull in the entire executable in order to run it. While a paging system will map the executable, pull in the first page to execute it, and only fault in further pages as required.
Same with working memory - a paging system will file-back the memory, and presumably flush dirty pages, and flag hot pages. While a swapping system will dump the entire memory, and read it all back, as required.
So a swapping system will be (relatively) slow because it's forever flushing and retrieving entire processes. A paging system on the other hand, will be dropping clean cold pages if required, so any program that is actively running will normally keep its hot paths in RAM without being dropped.
Cheers,
Wol
