[net.unix] Use of n option for ld

jgw@ptsfc.UUCP (John Weald) (10/25/86)

[]

I have some questions about the -n flag for ld(1) and its use on SV and 4.2.

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.

On moving to SV on VAX's + 3b product line the -n flag is ignored. You get
shared text by default. 64K for text and data is no longer a problem on 32 bit
machines.

Neither of the above is a demand paging system. Under SVR2 (paging) and
4.2 we have demand paging within which text pages are shared among all those
that need them(?).

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?

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?

If the paragraph is not true then that has widdled on my bonfire!

Come to think of it while I have your attention what is the difference between
4.2 paging and SRV2 paging apart from vfork?

Does the -n flag do anything else on other flavors of UNIX? 

John Weald

{ihnp4, pyramid}!ptsfa!ptsfc!jgw

guy@sun.uucp (Guy Harris) (10/26/86)

> 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@sun.com (or guy@sun.arpa)

barber@rabbit1.UUCP (Steve Barber) (10/31/86)

In article <727@ptsfc.UUCP>, jgw@ptsfc.UUCP (John Weald) writes:
> 
> Does the -n flag do anything else on other flavors of UNIX? 
> 
I have used a version of IN/ix (from Interactive Systems Corp,
writers of PC/ix, PC RT AIX and, I believe, IX/370, to name a few)
that used the -n flag to basically switch between the Intel "compact"
(64K total I & D) and "small" (64K each I & D) memory models.  I never
tried to use it running under IN/ix, but I did use it for generating
larger run files that I was downloading to a front end board....

This particular version of IN/ix was System III - based an ran on an
unamed 80186 based UNIX machine.



-- 
Steve Barber    Rabbit Software Corp.
...!ihnp4!{cbmvax,cuuxb}!hutch!barber  ...!psuvax1!burdvax!hutch!barber
(215) 647-0440  7 Great Valley Parkway East  Malvern PA 19355