lightly loaded system eats swap space
se at freebsd.org
Tue Jun 19 07:06:56 UTC 2018
Am 19.06.18 um 03:48 schrieb Erich Dollansky:
> A very long time ago - and not on FreeBSD but maybe on a real BSD - I
> worked with a system that swapped pages out just to bring it back as
> one contiguous block. This made a difference those days. I do not know
> if the code made it out of the university I was working at. I just
> imagine now that the code made it out and is still in use with the
> opposite effect.
If this was on a VAX, then it was due to a short-coming of the
MMU of the VAX, which used one linear array (in system virtual
memory) to hold physical addresses of user pages of all programs.
Each user program had 2 slices in this array (1 growing up, 1
growing down for the stack) and whenever a program allocated a
new page, this slice needed to grow. That leads to fragmentation
(same a problem as with realloc() for an ever growing array), and
when there was no contiguous free space in the array for a grown
slice, then all process where swapped out (resulting in this whole
page table array being cleared and thus without fragmentation,
since swapped-out processes needed no space in this array).
This was a solution that worked without the table walk used in
todays VM systems. System pages were mapped by a linear page table
in physical memory, while user programs used the above described
linear page table in system virtual memory.
Nothing of the above applies to any other architecture than the
VAX and thus the swap-out of all user processes serves no purpose
on any other system. It was an implementation detail of the VAX
VM code, not a BSD Unix feature.
More information about the freebsd-questions