Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 04 Jun 1997 11:10:09 -0700
From:      Julian Elischer <julian@whistle.com>
To:        current@freebsd.org
Cc:        dyson@freebsd.org
Subject:   rfork() man page wrong?
Message-ID:  <3395AF81.4487EB71@whistle.com>

next in thread | raw e-mail | index | archive | help
I've checked the man page and the sources..

it appears to me that the following section of the man page
is wrong..
john, if you are reading, can you check if this is what 
you understand?

-------
RFMEM     If set, the kernel will force sharing of the entire ad-
          dress space.  The child will then inherit all the shared
          segments the parent process owns. Other segment types
          will be unaffected.  Subsequent forks by the parent will
          then propagate the shared data and bss between children.
          The stack segment is always split.  May be set only with
          RFPROC.
--------

now, as I read it, the section 
                "The child will then inherit all the shared
          segments the parent process owns. Other segment types
          will be unaffected."

is wrong because in RFMEM case, the vmspace
is simply referenced twice, once by each process.
regardless of how what segments it is made up of.

(in the vm code.)
        if (flags & RFMEM) {
                p2->p_vmspace = p1->p_vmspace;
                p1->p_vmspace->vm_refcnt++;
        }


also:

"The stack segment is always split." seems to also be wrong..
(or is the stack not in the vmspace?)
though of course there is a separate kernel stack.


julian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3395AF81.4487EB71>