3 ms·
In theory, at least, swapping and paging are different ways to design a VM: https://stackoverflow.com/questions/4415254/difference-swapping-and-paging https://
by msla 4y ago
In theory, at least, swapping and paging are different ways to design a VM:
https://stackoverflow.com/questions/4415254/difference-swapping-and-paging https://stackoverflow.com/questions/4415254/difference-swapp...
> Swapping refers to copying the entire process address space, or at any rate, the non-shareable-text data segment, out to the swap device, or back, in one go (typically disk).
> Whereas paging refers to copying in/out one or more pages of the address space. In particular, this is at a much finer grain. For example, there are ~250,000 4 KB pages in a 1 GB RAM address space.
Since swapping is obsolete, that term has fallen into disuse, but we're talking about obsolete systems here:
> Hardware-wise, swapping can be performed without any memory management HW whatsoever, although the early machines employed a simple memory mapping scheme (e.g. base and bound, or a simple one level fixed size page mapping table (e.g. divide the 64 KB data address space into 8, 8KB pages in a larger physical address space (256 KB ... 4 MB)).
> In contrast, paging requires page-granularity virtual memory page table entries, which typically encode the physical address of the page, PTE bits such as valid, read, write, etc. The machine also needs to automatically (transparently to the application program) fetch and interpret page table entries as necessary to map each virtual address to its physical address, and/or take a page fault exception to enable the OS to make the page accessible and/or schedule an I/O to load it to physical RAM.