Re: Linux's Virtual Memory implementation

Torbjorn Lindgren (tl@fairplay.no)
Thu, 1 Apr 1999 23:14:19 +0200 (CEST)


On Fri, 2 Apr 1999, Martijn van Oosterhout wrote:
> After looking through "Operating systems: Internals
> and design principles" by William Stallings, I seem
> to have come to the conclusion that Linux's virtual
> memory is very different from other systems.
>
> For example, that book seems to imply that a system's
> virtual memory size is limited to the total amount of
> swap space given to the operating system. The stuff
> in main memory is merely a copy of a subset of the
> pages in virtual memory.

Sounds like the traditional BSD 4.x VM system, at least BSD 4.[23] worked
that way. I'm not sure if modern BSD 4.4 derivates (FreeBSD/OpenBSD/
NetBSD/BSDI) still have this.

IIRC the AT&T based system never had that "feature", and the book really
should mention something that fundamental.

The System V based systems I have seen all seems to allow you to use both
memory and swap, the question is mainly how much control you have
(IRIX giving most control, you can tell it how much overcommit it should
allow in MB/GB).

The same applies to the only OSF/1 based system I know of, Digital/Compaq
UNIX (you can turn it on and off in this case).

> Linux doesn't work like this. For example, I have a
> 16M swap < 64M main memory. Pages are only assigned
> to swap when memory is low.

AFAICR you wouldn't be able to use more than 16MB of your memory with a
BSD 4.[23] VM with that configuration...

> As an example, my dad said that under Solaris you can
> start a program and then remove the disk that the
> program is on. I'm fairly sure Linux can't do that.

IIRC Solaris also pages from the binary, and uses it as backing store, so
it shouldn't work, at least not for long (first time it needs something
that isn't already loaded, or something it has swapped out, BOOOM).

It might work if the sticky bit is set on the binary, the documentation is
a bit unclear on exactly what it does (and if they have implemented it)

-- 
Torbjörn Lindgren
Network Manager, FairPlay International AS
E-mail: tl@fairplay.no

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/