Re: Linux's Virtual Memory implementation

Theodore Y. Ts'o (tytso@mit.edu)
Fri, 2 Apr 1999 18:19:54 -0500 (EST)


Date: Fri, 02 Apr 1999 01:28:44 +1000
From: Martijn van Oosterhout <v3100411@student.anu.edu.au>

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.

Yes, Linux doesn't work this way. This is generally considered a feature,
not a bug. It means that if you have 64 megs of memory and 64 megs
of swap, you have 128 megs of virtual memory available to you, not 64
megs.

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.

Yes, you can't do this under Linux, but you can't do this under Solaris,
either. That's because traditional OS's reserve swap space when a
program starts, but they don't copy the program from the disk to the
swap space before allowing the program to start, for the obvious
performance reasons (think about how long it would take to copy GNU
emacs from the /usr filesystem to swap space!!!). So under nearly all
Unix systems, you can't unmount a filesystem if there's an executable
being run from that filesystem.

- Ted

-
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/