Use of n option for ld(1)

Guy Harris guy at sun.uucp
Sun Oct 26 18:53:36 AEST 1986


> In the days of programming on the PDP and AP16 (don't ask), under AT&T UNIX
> 3.0 the -n flag would give you shared text and separate I&D (as per the
> manual page for ld(1) - PDP-11 only). Great for 16 bit machines.

Gee, the System III (i.e., 3.0.1) manual we have here says that "-i" gives
you shared text and separate I&D; "-n" gives you shared text, but no
separate I&D.

> In the 4.2 manual for ld(1) it still says that -n gives you shared text. It
> would seem to me that this is not so. Without the source on our machine
> (CCI 6/32) and decent documentation (-: I am left to play and speculate, so
> forgive me if I am barking up the wrong tree. Am I right is assuming that
> the -n flag (magic # 0410) gives you a process that is not paged from
> the i-node? It must be "faulted" in, thus causing the possibility
> of pages being swapped out before being executed in an attempt to read the
> whole process into memory and a larger initial resident set size?

"-n" gives you shared text on all versions of UNIX I know about.  In 4.2, it
gives you shared text that is not paged in from the i-node, i.e. it is NOT
faulted in.  "-z" gives you shared text that *is* paged in from the i-node,
i.e. it is faulted in.  If you meant to say "loaded in all at once" rather
than "'faulted' in", you are correct, except that, as stated, even though
something loaded with "-n" is not faulted in it still has shared text.

> If the above paragraph is true why would one want to load with the -n?
> I can see it if you know that your process is small or is going to
> do abnormal behavior unsuitable for paging from the i-node (what did
> happen to vadvise (-: ). Why else would you use it?

You would use it if your process is small, as you stated.  If you drag in
99% of the pages of a program early on, you're better off reading it in all
at once because it takes longer to load it piecemeal by paging than by
loading it all at once.
-- 
	Guy Harris
	{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
	guy at sun.com (or guy at sun.arpa)



More information about the Comp.unix mailing list