From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f4671,b99fa0452d65d12 X-Google-Attributes: gidf4671,public X-Google-Thread: 1164f8,b99fa0452d65d12 X-Google-Attributes: gid1164f8,public X-Google-Thread: 114b0c,b99fa0452d65d12 X-Google-Attributes: gid114b0c,public X-Google-Thread: 112114,b99fa0452d65d12 X-Google-Attributes: gid112114,public X-Google-ArrivalTime: 1993-09-23 09:20:06 PST Xref: gmd.de comp.sys.sun.hardware:12106 comp.sys.hp:24925 comp.sys.dec:10294 Newsgroups: comp.sys.ibm,comp.sys.sun.hardware,comp.sys.hp,comp.sys.dec Path: gmd.de!newsserver.jvnc.net!howland.reston.ans.net!vixen.cso.uiuc.edu!moe.ksu.ksu.edu!mars.dsu.edu!dsuvax.dsu.edu!ghelmer From: ghelmer@dsuvax.dsu.edu (Guy Helmer) Subject: Re: Most "crunch" for the dollar Message-ID: <1993Sep23.155912.19283@dsuvax.dsu.edu> Organization: Dakota State University References: <27negn$d0r@usenet.pa.dec.com> <1993Sep22.080053.1184@ica.philips.nl> <27q56q$sh0@usenet.pa.dec.com> <1993Sep23.085728.344@ica.philips.nl> Date: Thu, 23 Sep 1993 15:59:12 GMT In <1993Sep23.085728.344@ica.philips.nl> adrie@ica.philips.nl (Adrie Koolen) writes: >In article <27q56q$sh0@usenet.pa.dec.com> grant@pa.dec.com writes: >> >>>|>Our HP 720s and 715 seem to allocate VM as needed. >> >>>>which means they aren't POSIX compliant. POSIX requires that you allocate the >>>>memory that could be used at the time of startup. >> >>>I don't know the POSIX spec, but to "allocate the memory that could be used at >>>the time of startup" looks impossible to me. How do you (or the OS) know at >>>startup time how much memory the process is going to use in its lifetime. I >>>can't believe that POSIX demands you to allocate all memory to the first >>>process. >> >>the startup of the application, not the system. >What's that supposed to mean? If the OS (system?) starts running and the >first process is created, the OS has to allocate all memory that the process >is going to need in its lifetime (according to POSIX). As the OS doesn't >know the amount of memory that will be needed, the best thing it can do is >to allocate ALL memory to the first process. The second process will then >not be able to get any memory and therefore only one process can be run. The "eager allocation" mechanism just requires that there be enough virtual memory swap space allocated to hold all of the current pages of all of the processes. This prevents the problem of having a process being killed by the kernel because the process wants to write to a copy-on-write page that's shared with the parent process or mapped from a read-only executable file, but the kernel is out of vm swap space. For example, initially a child process shares all of the pages with its parent (after a fork(2)), then accumulates private pages of data as it writes to memory, causing vm faults which allocate free vm pages, copy the parent's original page of data to the new one, and assign the new page to the child. In a system using "lazy allocation", the child process could be killed by the kernel because it ran out of swap space when trying to find a free vm page to allocate; using "eager allocation", the fork(2) (or some other process's fork(2) or exec(2) executed later) would have failed and the process never would have started; the point of eager allocation is that a process won't die unexpectedly. Clear as mud, right? :-) -- Guy Helmer, Dakota State University Computing Services - ghelmer@dsuvax.dsu.edu Home is where the CPU is.