[comp.arch] allocate-on-fault

andrew@frip.gwd.tek.com (Andrew Klossner) (02/21/89)

Andy "Krazy" Glew (aglew@urbana.mcd.mot.com) writes:

	"... systems should provide a way for low-overhead virtual
	address space - basically, to fault-allocate (as opposed to the
	more common faulting in of already allocated) memory."

One reason not to do so (and it's a weak one) is that, by requiring the
process explicitly to allocate its address space, you give the
operating system a channel by which it can say that there aren't enough
resources to satisfy the request.  For example, a process trying to
fill out its 4G might be told that there aren't 4G of swap space
available.  In Unix, this takes the form of an error return from
sbrk(2).

Otherwise, the process doesn't learn of the resource limitation until
it goes to touch a valid virtual page which can't be faulted in, and
gets some sort of signal, or (worse) the kernel sends a signal on
failure to allocate a backing store page frame at page-out time, when
the process is likely doing something completely unrelated to memory
allocation.

I say this reason is weak because some Unix implementations (like ours)
give a non-error return from a huge sbrk even if the swap space isn't
there, so as to implement the sort of address space model that Andy
suggests.

  -=- Andrew Klossner   (uunet!tektronix!orca!frip!andrew)      [UUCP]
                        (andrew%frip.wv.tek.com@relay.cs.net)   [ARPA]