Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!caen!sdd.hp.com!wuarchive!uunet!viusys!uxui!unislc!harem!wes From: wes@harem.clydeunix.com (Wes Peters) Newsgroups: comp.unix.sysv386 Subject: Re: out of swap space?? Summary: It was there, you just didn't find it - see algorithm allocreg Message-ID: <241@harem.clydeunix.com> Date: 6 May 91 14:25:23 GMT References: <1991Apr23.214037.16410@netcom.COM> <296@dumbcat.sf.ca.us> Organization: Raxco, Inc., Orem, UT Lines: 31 In article <296@dumbcat.sf.ca.us>, marc@dumbcat.sf.ca.us (Marco S Hyman) writes: > Hmmm. I seem to remember that Berkeley UNIX allocates swap space at exec time > to ensure a process can be swapped out later. (I can't verify this right > now... it may be a false statement.) If true, you'll have to allocate that > disk space even if it's never used. I just looked thru Bach's "The Design of > the UNIX Operating System" and don't see a similar requirement for System V. > I wonder about System V Release 4, though. Does anybody know? It was there in Bach, just not under the heading "swap." If you look under the description of exec, the algorithm mentions that space is allocated for each region in the executable file, and points you to the algorithm 'allocreg.' This is essentially where 'swap' space, actually 'page' space in paging systems, is allocated. > When a process is swapped only the active pages are written to the swap > device. The swapped out process is placed in a state "ready to run but > swapped." These processes are not swapped back into memory in their entirety > -- they are allowed to page fault back in off of the swap device. I think System V.3 does this at fork/exec calls, too. I remember hearing somewhere about 'direct page-in,' i.e. when you fork or exec, the system merely pages in the first executable page (or block of pages) and starts it; the rest of the process is paged in as needed. Supposed to make programs start faster or something like that. Wes Peters -- #include The worst day sailing My opinions, your screen. is much better than Raxco had nothing to do with this! the best day at work. Wes Peters: wes@harem.clydeunix.com ...!sun!unislc!harem!wes