home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!mcsun!news.funet.fi!hydra!klaava!klaava!liljeber
- From: liljeber@klaava.Helsinki.FI (Mika Pekka Liljeberg)
- Newsgroups: comp.os.linux
- Subject: Re: shared libs - can everyone be happy with this?
- Message-ID: <LILJEBER.92Aug17203359@klaava.Helsinki.FI>
- Date: 17 Aug 92 18:33:59 GMT
- References: <1992Aug17.144719.1961@crd.ge.com> <1992Aug17.151311.29507@ods.com>
- Sender: liljeber@klaava.Helsinki.FI (Mika Pekka Liljeberg)
- Organization: Department of Computer Science, University of Helsinki, Finland
- Lines: 52
- In-Reply-To: david@ods.com's message of 17 Aug 92 15: 13:11 GMT
-
- In article <1992Aug17.151311.29507@ods.com> david@ods.com (David Engel) wrote:
- > william E Davidsen (davidsen@ariel.crd.GE.COM) wrote:
- > : In article <1992Aug17.065450.28834@colorado.edu>, drew@ophelia.cs.colorado.edu (Drew Eckhardt) writes:
- > :
- > : | Boom. You've just dirtied that page, and it is no longer
- > : | shareable. So, instead of having > 200K shared between all
- > : | of your shells, you have closer to 800K (Who has less than
- > : | 4 shells running at a time). Not a good thing (tm).
- > :
- > : Well, no, actually. Since the new version of the page is still valid
- > : for all processes it would still be sharable. And it would not have to
- > : be saved somewhere in the unlikely event that it gets paged out, because
- > : the unmodified varsion is still perfectly valid.
- >
- > No, it wouldn't be shareable. When a process writes to a shared page,
- > it gets its very own copy of it which is no longer shared. There is a
- > term for this that you probably already know, but others may not. It's
- > called Copy-On-Write.
-
- I'll admit right away that I'm no expert, but it seems to me that William is
- right. The page _could_ still be shared, since all the processes using the
- page would be using the same libs. Of course, some kernel support would be
- needed: The page fault handler would have to check, if the referenced address
- is in library space and if so, fix the reference to point to the correct
- place in the library and clear the dirty-bit for that page instead of doing
- a Copy On Write. This would also work for static data references, as long as
- the data structures didn't change too profoundly.
-
- Would this break demand loading, then? I think not. A text page could still
- be freed and reloaded on demand. Any library references on it would simply
- get relinked, when the path of execution intercepted them.
-
- Also, I don't think this would bloat the kernel much at all. It would be a
- fairly small addition to the page fault handler (ok, if I'm wrong, sue me).
-
- So, what am I missing? I know you have researched this matter thoroughly and
- have decided that jump libs are The Way It Should Be Done (and a good way it
- is, too). But why not do it this way? (btw, I followed the discussion on the
- GCC channel, when it was most heated and I don't recall seeing anything to
- prevent this).
-
- > David
- > --
- > David Engel Optical Data Systems, Inc.
- > david@ods.com 1101 E. Arapaho Road
- > (214) 234-6400 Richardson, TX 75081
-
- Mika
- --
- Mika Liljeberg Email: liljeber@kruuna.Helsinki.FI
- Helsinki University Mika.Liljeberg@Helsinki.FI
- Dept. of Computer Science
-