From owner-freebsd-questions Thu Nov 16 14: 6:10 2000 Delivered-To: freebsd-questions@freebsd.org Received: from pike.osd.bsdi.com (pike.osd.bsdi.com [204.216.28.222]) by hub.freebsd.org (Postfix) with ESMTP id 1974F37B4CF for ; Thu, 16 Nov 2000 14:06:08 -0800 (PST) Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241]) by pike.osd.bsdi.com (8.11.0/8.9.3) with ESMTP id eAGM5tB68624; Thu, 16 Nov 2000 14:05:55 -0800 (PST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <3A1BFC94@zathras.cc.vt.edu> Date: Thu, 16 Nov 2000 14:06:34 -0800 (PST) From: John Baldwin To: flaw Subject: RE: FreeBSD VM Cc: freebsd-questions Cc: freebsd-questions , George Reid Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 16-Nov-00 flaw wrote: > Thanks for the reply. When exactly is majflt incremented? > > I ran ps -o majflt -p on the Netscape process and it gave me a count of > 291 the first time I ran Netscape after reboot. I killed the process and ran > Netscape again. This time it gave me a count of 0. This is because the pages that Netscape faults in from disk (the text pages) were still in memory. When a process exits, its pages don't get dumped from memory right away. Instead, after the pages have sat for a while without being used they are marked as inactive. When new pages are needed, pages are grabbed from the inactive pool. If you are really interested in this stuff, I highly recommend that you get 'The Design and Implementation of 4.4 BSD' (a book). > Thanks. > Ray, > >>===== Original Message From George Reid ===== >>On Thu, 16 Nov 2000, Raymond Law wrote: >> >>> majflt doesn't increase when a process is generating page faults. Instead, >>> the swapper process (pid 0) gets all the page faults and it is the same as >>> the page faults given by cnt in vmmeter.c. Why is this happening? Is >>> there a way to get the number of page faults generated by a SINGLE process? >> >>Yes. >>ps -o majflt -p >> >>The code which increments the number of page faults for a given process is >>found in /sys/vm/vm_fault.c (circa line >>856): curproc->p_stats->p_ru.ru_majflt++; >> >>> The above doesn't get increased. >> >>Yes, it does - certainly in 5.0-CURRENT and a quick look at the CVS >>repository reveals this code has been present for over 6 years. >> >>"And then it comes to be that the soothing light >> at the end of your tunnel was just a freight >> train, comin' your way." >> >> George Reid * greid@ukug.uk.freebsd.org >> >> >> >>To Unsubscribe: send mail to majordomo@FreeBSD.org >>with "unsubscribe freebsd-questions" in the body of the message > > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message