Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!tut.cis.ohio-state.edu!pt.cs.cmu.edu!andrew.cmu.edu!+ From: Richard.Draves@CS.CMU.EDU Newsgroups: comp.os.mach Subject: Re: External pagers and sharing Message-ID: Date: 28 Mar 90 19:53:32 GMT References: <10026@spool.cs.wisc.edu> Organization: Carnegie Mellon, Pittsburgh, PA Lines: 26 In-Reply-To: <10026@spool.cs.wisc.edu> > Excerpts from netnews.comp.os.mach: 27-Mar-90 External pagers and > sharing Mike Zwilling@edam.cs.wi (1766) > I have a question concerning physical memory sharing among multiple > clients of an external pager. Consider the following scenario: > Assume we have one the same machine an external pager with 2 > clients. Client 1 uses memory_object_1 and client 2 uses > memory_object_2. Both memory objects are maintained by the > same external pager. Further assume that page 1 in each object > is identical (eg. in the same file) and that each client requires > only read access to page 1. Now, it would be preferable for the > clients to share the same physical page containing page 1 (since > they are not writing the page). This could be "implemented" by > return a pointer to the same data in the > memory_object_data_provided calls. Unfortunately, no. The VM implementation doesn't allow sharing of physical pages among multiple memory objects. You can only get sharing by mapping the same memory object multiple times. The implementation of memory_object_data_provided can't take advantage of copy-on-write; it actually copies the data you give it into the target memory object. Mach would need another page-level copy-on-write mechanism to make this kind of sharing happen. Rich