9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] Virtual memory & paging
@ 2002-02-04 10:38 geoff
  2002-02-04 11:16 ` Boyd Roberts
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: geoff @ 2002-02-04 10:38 UTC (permalink / raw)
  To: 9fans

There isn't a copy of the entire C library in every binary.  There is
a copy of each library routine called, directly or indirectly, by the
program in question.

Sharing of instructions is done at the granularity of process text
segments, as in V6 or V7 Unix.  The text segment of a process that
forks is shared between parent and child by page mapping.  Also,
running (via exec) a program multiple times concurrently causes the
(pure) text segment to be shared by page mapping across those
processes.  So all copies of rc and on a machine should share a text
segment.

Given that degree of sharing, the low cost of RAM, and the increase in
OS complexity, slowness and insecurity in the implementations of
dynamic libraries that I've seen, I don't see a need for dynamic
libraries.  (Remember that the real impetus for adding them to Unix
was X11 and its big and badly-factored libraries, which most of us
aren't blessed with.)  My terminal has 115 processes; all but 4 of
them share their text segment with at least one other process, usually
more.  74 of them are instances of rio, Mail, rc, acme, listen,
plumber and samterm.  A CPU server has 141 processes; all but 2 share
text.  80 of them are listen, another 21 are rc, exportfs, kfs, dns
and consolefs.  A quick sampling suggests that Plan 9 programs are
typically smaller than FreeBSD/386 programs even with shared
libraries.  Here are some FreeBSD sizes:

: unix; size /bin/cat /bin/ed /usr/bin/awk /usr/X11/bin/sam
   text    data     bss     dec     hex filename
  54188    4324    9760   68272   10ab0 /bin/cat
 122835    8772   81920  213527   34217 /bin/ed
 135761    4772   15756  156289   26281 /usr/bin/awk
  52525    1412   53448  107385   1a379 /usr/X11/bin/sam

Of those, awk and sam use shared libraries.  The corresponding Plan 9
sizes are:

; cd /bin; size cat ed awk sam
15996t + 2208d + 944b = 19148	cat
45964t + 4212d + 41232b = 91408	ed
114731t + 35660d + 12040b = 162431	awk
86574t + 7800d + 66240b = 160614	sam

and the Plan 9 programs cope with Unicode and UTF.



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Virtual memory & paging
  2002-02-04 10:38 [9fans] Virtual memory & paging geoff
@ 2002-02-04 11:16 ` Boyd Roberts
  2002-02-04 11:45 ` Boyd Roberts
  2002-02-05  9:53 ` [9fans] Virtual memory & paging Thomas Bushnell, BSG
  2 siblings, 0 replies; 9+ messages in thread
From: Boyd Roberts @ 2002-02-04 11:16 UTC (permalink / raw)
  To: 9fans

geoff@collyer.net wrote:
> Given that degree of sharing, the low cost of RAM, and the increase in
> OS complexity, slowness and insecurity in the implementations of
> dynamic libraries that I've seen, I don't see a need for dynamic
> libraries.

Neither do I.  Didn't the tests show that the implementation of them
on unix actually made things slower and more memory got used, not less?

Virtual memory usually refers to the management of the memory when you
allow more 'memory' to be used than you have physical memory.  It always
implies a private virtual address space (unlike those Dragonball based
Palm things).

Hence you could have a private virtual address space but no virtual memory.
This would limit the size of the collection of processes on the machine to
not consume more that the amount of physical memory you had.

Once you have a private virtual address space [essential, except in certain
special cases] you can then manage the physical memory in any way you like.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Virtual memory & paging
  2002-02-04 10:38 [9fans] Virtual memory & paging geoff
  2002-02-04 11:16 ` Boyd Roberts
@ 2002-02-04 11:45 ` Boyd Roberts
  2002-02-04 17:10   ` Andrew Simmons
  2002-03-30  4:26   ` Richard Maxwell Underwood
  2002-02-05  9:53 ` [9fans] Virtual memory & paging Thomas Bushnell, BSG
  2 siblings, 2 replies; 9+ messages in thread
From: Boyd Roberts @ 2002-02-04 11:45 UTC (permalink / raw)
  To: 9fans

geoff@collyer.net wrote:
> Given that degree of sharing, the low cost of RAM, and the increase in
> OS complexity, slowness and insecurity in the implementations of
> dynamic libraries that I've seen, I don't see a need for dynamic
> libraries.

Oh, if it comes to DLLs, those things are 'orrible; every 'process'
shares the DLL's data segment.  That's one reason why it is impossible
to write a correct windows program.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Virtual memory & paging
  2002-02-04 11:45 ` Boyd Roberts
@ 2002-02-04 17:10   ` Andrew Simmons
  2002-02-05 11:17     ` Boyd Roberts
  2002-03-30  4:26   ` Richard Maxwell Underwood
  1 sibling, 1 reply; 9+ messages in thread
From: Andrew Simmons @ 2002-02-04 17:10 UTC (permalink / raw)
  To: 9fans

 That's one reason why it is impossible
>to write a correct windows program.
>
Another reason of course is that we Windows programmers are simply not very
bright.

Could anyone recommend a good book to help me remedy my profound ignorance
of these matters? I'm looking for a conceptual overview, nothing too heavy,
rather than something that will actually teach me how to write an OS.
Andrey mentioned Silberschatz & Galvin - would that fit the bill?



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Virtual memory & paging
  2002-02-04 10:38 [9fans] Virtual memory & paging geoff
  2002-02-04 11:16 ` Boyd Roberts
  2002-02-04 11:45 ` Boyd Roberts
@ 2002-02-05  9:53 ` Thomas Bushnell, BSG
  2002-02-05 16:06   ` Ronald G Minnich
  2 siblings, 1 reply; 9+ messages in thread
From: Thomas Bushnell, BSG @ 2002-02-05  9:53 UTC (permalink / raw)
  To: 9fans

geoff@collyer.net writes:

> Given that degree of sharing, the low cost of RAM, and the increase in
> OS complexity, slowness and insecurity in the implementations of
> dynamic libraries that I've seen, I don't see a need for dynamic
> libraries.  

Well, this sounds a little like "it's inherently buggy", which is
false.  If you don't trust yourself to write a shared library
implementation correctly, then say so, but I think the Plan 9 authors
are certainly capable of writing one that works right.

There may be other reason to not want them--as I'm sure the Plan 9
authors have chosen.  However, "we can't write an implementation
without bugs" is not a good reason.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Virtual memory & paging
  2002-02-04 17:10   ` Andrew Simmons
@ 2002-02-05 11:17     ` Boyd Roberts
  0 siblings, 0 replies; 9+ messages in thread
From: Boyd Roberts @ 2002-02-05 11:17 UTC (permalink / raw)
  To: 9fans

Andrew Simmons wrote:
> Another reason of course is that we Windows programmers are simply not very
> bright.

There is that, but the environment is so hostile it really is hard.

> Could anyone recommend a good book to help me remedy my profound ignorance
> of these matters? I'm looking for a conceptual overview, nothing too heavy,
> rather than something that will actually teach me how to write an OS.
> Andrey mentioned Silberschatz & Galvin - would that fit the bill?

When I were a lad, we used this:

    Fundamentals of Operating Systems 
    By A. Lister

    Hardcover 
    161 Pages
    Edition: 3rd ed
    Published by Springer-Verlag New York, Incorporated
    Date Published: 09/1985
    ISBN: 0387912517

At 161 pages it makes it a 'readable' size.  The rest I picked up 'the hard way'
(tm) or from brucee or maltby.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Virtual memory & paging
  2002-02-05  9:53 ` [9fans] Virtual memory & paging Thomas Bushnell, BSG
@ 2002-02-05 16:06   ` Ronald G Minnich
  0 siblings, 0 replies; 9+ messages in thread
From: Ronald G Minnich @ 2002-02-05 16:06 UTC (permalink / raw)
  To: 9fans

> geoff@collyer.net writes:
> > Given that degree of sharing, the low cost of RAM, and the increase in
> > OS complexity, slowness and insecurity in the implementations of
> > dynamic libraries that I've seen, I don't see a need for dynamic
> > libraries.

and in the worst case you'll end up where GNU is now, with symbol
versioning, 21 different versions of opendir in glibc, and so on an so on.
Watching a simple 'ls' do hundreds of symbol fixups is really
enlightening. Especially when so many of them are for the same symbol with
slight variations on the name. My simple, formerly working, libc-based
private name spaces are still totally hosed due to this nonsense.

ron



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [9fans] Virtual memory & paging
  2002-02-04 11:45 ` Boyd Roberts
  2002-02-04 17:10   ` Andrew Simmons
@ 2002-03-30  4:26   ` Richard Maxwell Underwood
  2002-03-30  5:46     ` [9fans] Uncluttering Richard Maxwell Underwood
  1 sibling, 1 reply; 9+ messages in thread
From: Richard Maxwell Underwood @ 2002-03-30  4:26 UTC (permalink / raw)
  To: 9fans

   I loathe memorizing petty details like
   which drawer has the soap and whether a constructor has to be declared
   in a private or public section of an object definition. I detest
   software designs that have special cases or exceptions. I'm always
   cursing Microsoft -- they seem to design all their software by random
   accretion of features.
   
   What's particularly odd to me is the pride some people take in their
   mastery of clutter. It's especially true of techies -- they love to
   indulge in the memorization of mountains of meaningless minutiae.
   Indeed, I suspect that the pride they take in this pap influences the
   design: software tools are most successful when they create a
   priesthood knowledgeable in the arcane incantations required.
   
   Perhaps this is all for the best -- after all, society can't afford a
   high ratio of geniuses to grunts. Perhaps society has come up with the
   perfect means of profitably employing those moiling masses of mental
   midgets. They're not dullards -- they're specialists! They may not
   understand much, but they certainly have gotten all the details of
   c++, HTML, Java, perl, Windows 95, or JCL down pat. So I don't want to
   be too hard on the mentality. But you must ask yourself where you fit
   into the grand scheme of things. Are you one of those moiling mental
   midgets, or do you seek grander things for yourself?
   
   The truth is simple and obvious: you can only think clearly when you
   purge your mind of clutter. Any real-world decision is impinged upon
   by milliards of factors, but turns on only a few. The ability to slice
   through all the secondary factors and zero in on the crucial ones is
   central to good decision-making.

-- 
Richard Maxwell Underwood
The Internet Is Missing!  http://www.satn.org/about/missinginternet.htm



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [9fans] Uncluttering
  2002-03-30  4:26   ` Richard Maxwell Underwood
@ 2002-03-30  5:46     ` Richard Maxwell Underwood
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Maxwell Underwood @ 2002-03-30  5:46 UTC (permalink / raw)
  To: 9fans

Oops!  I hit send before I meant to.  And the subject is all wrong.
Anyways.

What I just posted is an excerpt from
http://www.erasmatazz.com/library/Mind/How_to_Think_Uncluttering.html

At first it seems offtopic, till you realize that software
preferences often mirror cognitive styles.  What is important about
Plan 9, IMO, is not how the software differs from other software, but
rather how people who prefer Plan 9 differ from people who prefer,
eg, Linux or Perl.

The quote I just posted was written by someone with a BS and MS in
physics.  Physics definitely has that property that the people who
do it well are the ones who have a habit of searching for the handful of 
important facts among the milliards.  
-- 
Richard Maxwell Underwood
The Internet Is Missing!  http://www.satn.org/about/missinginternet.htm



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-03-30  5:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-04 10:38 [9fans] Virtual memory & paging geoff
2002-02-04 11:16 ` Boyd Roberts
2002-02-04 11:45 ` Boyd Roberts
2002-02-04 17:10   ` Andrew Simmons
2002-02-05 11:17     ` Boyd Roberts
2002-03-30  4:26   ` Richard Maxwell Underwood
2002-03-30  5:46     ` [9fans] Uncluttering Richard Maxwell Underwood
2002-02-05  9:53 ` [9fans] Virtual memory & paging Thomas Bushnell, BSG
2002-02-05 16:06   ` Ronald G Minnich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).