From owner-freebsd-hackers Fri May 17 08:45:04 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id IAA26000 for hackers-outgoing; Fri, 17 May 1996 08:45:04 -0700 (PDT) Received: from brasil.moneng.mei.com (brasil.moneng.mei.com [151.186.109.160]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id IAA25985 for ; Fri, 17 May 1996 08:44:58 -0700 (PDT) Received: (from jgreco@localhost) by brasil.moneng.mei.com (8.7.Beta.1/8.7.Beta.1) id KAA15402; Fri, 17 May 1996 10:43:55 -0500 From: Joe Greco Message-Id: <199605171543.KAA15402@brasil.moneng.mei.com> Subject: Re: joe's questions on vm/mincore/etc. To: toor@dyson.iquest.net (John S. Dyson) Date: Fri, 17 May 1996 10:43:55 -0500 (CDT) Cc: syssgm@devetir.qld.gov.au, freebsd-hackers@freebsd.org In-Reply-To: <199605171450.JAA00769@dyson.iquest.net> from "John S. Dyson" at May 17, 96 09:50:16 am X-Mailer: ELM [version 2.4 PL24] Content-Type: text Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > >(I was looking at this in part because it works under at least one other > > >major OS, SunOS/Solaris, and I run news servers under both environments). > > > > At first glance his suggestion looks hideously non-portable, but there is > > nothing stopping you from writing a system call that does the mapping, and > > a FreeBSD/i386 specific library routine (called mincore) which gropes the > > mapped ptes and gives you your answer. Second and subsequent mincore calls > > would not call the kernel. Thus you keep the published interface and > > published behaviour, yet have nasty (hopefully fast) code behind the scenes. > > > > You could implement that SystemV ipc stuff with these sorts of tricks too, > > and eject it from the kernel. Anyone for a kernel purity purge? :-) > Problem is that there are (sometimes) alot of pages in an object that are > not mapped into the process, but are in memory. The pte's are only part > of the picture. If you use the pte mechanism, you'll get information > about pages that are in memory, and won't have to be faulted into the > process. The scenario, I assume, where this would happen is where somebody else accesses the page? I would _guess_ that this would not be a significant issue (or an issue at all) for a scenario where a single process was involved. This is the case I am dealing with :-) . Given past experience with systems engineering, I will forward this counterproposal, without having ANY idea how easy it might be to implement: A general purpose function to reveal information about VM issues. I would like to be able to determine: o Page mapped by pte and incore o Page mapped by pte and not incore o Page not resolved by pte (yet) (those three should be easy, as far as I can tell) o Page available incore o Page not available incore (harder) o Number of references to a page (maybe split into non-COW and COW sharings, etc)? to help determine efficiencies of shlibs, etc. o Other relevant detailed information. (*****!!!!!!!) I would not mind taking a syscall hit for this sort of info, maybe even if I had to retrieve information about pages one at a time :-) This sort of information is noticeably lacking in most OS's, and systems engineers like me are constantly swearing because we can't systematically determine the benefits of sharing libraries and things like that. We have to look at the bigger picture and make a "judgement call". I don't mind adding a code to an application to iterate through all its pages and gather statistics... but I hate that the information needed for the statistics is not available. Maybe a facility to map the pte's, and a separate facility to get more detailed information about a particular pte, for those of us who might care (and don't care about a syscall hit to get that additional info)? Does this sound like a Project yet? ;-) You did say you wanted something to do this weekend ;-) ... Joe ------------------------------------------------------------------------------- Joe Greco - Systems Administrator jgreco@ns.sol.net Solaria Public Access UNIX - Milwaukee, WI 414/546-7968