Re: Linux's Virtual Memory implementation

Mark H. Wood (mwood@iupui.edu)
Sat, 3 Apr 1999 06:33:11 -0500 (EST)


On Fri, 2 Apr 1999, Theodore Y. Ts'o wrote:
[deletia]
> 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.

Indeed, there's no reason to ever write pure code pages into swap space
since you can just page them from the original image. Only writable pages
should ever swap out; if an executable page's page frame is reclaimed then
the page should just be unmapped and forgotten, to be reread from the
image when faulted in. So you couldn't ever get to a state in which the
disk containing the image could be umounted while the image is running,
because it will always be busy.

-- 
Mark H. Wood, Lead System Programmer   mwood@IUPUI.Edu
Specializing in unusual perspectives for more than twenty years.

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