Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: ghelmer@dsuvax.dsu.edu (Guy Helmer)
Subject: Re: Most "crunch" for the dollar
Date: Thu, 23 Sep 1993 15:59:12 GMT	[thread overview]
Message-ID: <1993Sep23.155912.19283@dsuvax.dsu.edu> (raw)
In-Reply-To: 1993Sep23.085728.344@ica.philips.nl

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.


  parent reply	other threads:[~1993-09-23 15:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-09-07 20:40 Most "crunch" for the dollar Michael Raynold Zika
1993-09-08 13:21 ` Gerald Cecil
1993-09-10 17:32 ` Allen Leibowitz
1993-09-10 22:00   ` Lezz Giles
1993-09-10 19:21 ` Robert Plamondon
1993-09-10 20:38   ` Allen Leibowitz
1993-09-13  0:34   ` Aaron Sloman
1993-09-14 14:27   ` Sean.Levy
1993-09-16  2:39     ` Art Stine
1993-09-21 10:22     ` Nick Watkins
1993-09-21 17:43       ` Gail L. Grant
1993-09-22  8:00         ` Adrie Koolen
1993-09-22 18:23           ` Gail L. Grant
1993-09-22 20:05             ` Channing Benson
1993-09-24  1:36               ` Jim Rice
1993-09-23  8:57             ` Adrie Koolen
1993-09-23 14:41               ` Robert Andrew Ryan
1993-09-23 15:59               ` Guy Helmer [this message]
1993-09-23 21:47               ` Eric D Osborne
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox