Path: utzoo!utgpu!watserv1!watmath!att!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!samsung!emory!mephisto!bbn.com!lkaplan From: lkaplan@bbn.com (Larry Kaplan) Newsgroups: comp.unix.wizards Subject: /dev/zero and MAP_ANON (was: Re: GC triggering ...) Message-ID: <58352@bbn.BBN.COM> Date: 23 Jul 90 13:52:46 GMT References: <3260@swi.swi.psy.uva.nl> <58338@bbn.BBN.COM> <3713@auspex.auspex.com> Sender: news@bbn.com Reply-To: lkaplan@BBN.COM (Larry Kaplan) Organization: Bolt Beranek and Newman Inc., Cambridge MA Lines: 32 In article <3713@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes: >>>Rather than mapping a file, you can map /dev/zero, which provides zero >>>filled copy on write pages. > >No, it provides zero-fill on demand pages; there's no copy-on-write >involved, and no copy-on-write needed. > >>Ever hear of anonymous mapped memory. > >Yes, it's what you get when you "mmap()" "/dev/zero" in SunOS 4.x and >System V Release 4. > >>Check out the 4.3BSD Architecture Manual (PS1:6) for a description of >>this rarely (or almost never) implemented feature. Here is a question for you about mmap of /dev/zero. Is this a useful feature for unrelated processes to share memory? The nice thing about MAP_ANON on an arbitrary path name (or vnode) is the ability to have separate sets of unrelated processes sharing memory. Just choose some job related file name in /tmp and map it with MAP_ANON. The file name (vnode) is used simply for rendezvous but no space is actually allocated in the file. Paging is done to the normal paging areas. It seems that you couldn't have separate groups with /dev/zero. Are there any other ways to share zero-filled memory without consuming disk space (as with regular mapped files) for unrelated processes in these operating systems? #include _______________________________________________________________________________ ____ \ / ____ Laurence S. Kaplan | \ 0 / | BBN Advanced Computers lkaplan@bbn.com \____|||____/ 10 Fawcett St. (617) 873-2431 /__/ | \__\ Cambridge, MA 02238