*BSD News Article 37021


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!yeshua.marcam.com!news.kei.com!ddsw1!not-for-mail
From: mikebo@MCS.COM (Michael Borowiec)
Newsgroups: comp.unix.bsd
Subject: Re: fork/vfork accounting in the kernel
Date: 16 Oct 1994 10:52:51 -0500
Organization: MCSnet, Chicago Area Public Internet Access
Lines: 45
Message-ID: <37ri8j$lgu@Mars.mcs.com>
References: <374j2h$gev@mercury.mcs.com> <KSTAILEY.94Oct14132833@leidecker>
NNTP-Posting-Host: mars.mcs.com

In article <KSTAILEY.94Oct14132833@leidecker>,
 <kstailey@leidecker.std.com> wrote:
>>In article <374j2h$gev@Mercury.mcs.com>,
  mikebo@MCS.COM (Michael Borowiec) writes:
>>
>> SunOS does fork/vfork accounting using a structure called "forkstat",
>> containing ints cntfork, cntvfork, sizfork, sizvfork. I don't find
>> any mechanism like this in FreeBSD. It's like six lines and could have 
>> been put just about anywhere in fork1() or vm_fork() where isvfork is
>> tested. Do other BSDs have this structure? Am I missing something, or
>> doesn't anyone (but me) care about this information? 8v)
>>
>4.3BSD has this, but later versions use Mach virtual memory.  It's
>probably not trivial to get forkstat to work, and it's less important
>because of the introduction of copy on write paging.
>
I'm not a kernel hacker by any stretch. Nevertheless, I'm trying to
port the "mon" program to FreeBSD (assuming it hasn't been done
already). Anyway, all I want to do is find out how many times fork or
vfork has been called during some period of time. It sure *seems* trivial
to me having looked at the 4.3BSD kernel code which increments the int's
in the forkstat struct. It's not like a system call or anything; just a
kernel variable increment/read. Like I said, only four real lines of code.

Why is the number of times fork has been called any less (or more)
important? I guess I can accept that perhaps fork has less impact on the
speed of the OS because of the Mach VM system... but I can't believe
it's totally irrelevant. Besides, I thought it was an interesting stat,
if for performance monitoring purposes if nothing else.
- Mike
--------------------------------------------------------------------------
Michael Borowiec			All tied to their things,
mikebo@MCS.COM				they are netted by the strings...
					Free to flutter, in memory of
					their wasted wings...  P.Gabriel

--RAA06699.782173161/kitten.mcs.com--


-- 
--------------------------------------------------------------------------
Michael Borowiec			All tied to their things,
mikebo@MCS.COM				they are netted by the strings...
					Free to flutter, in memory of
					their wasted wings...  P.Gabriel