linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* suggestion for improvement to vfork() man page
@ 2012-01-19  3:16 starlight-Utvwg/EOxnhfq8cQ1yknNg
       [not found] ` <6.2.5.6.2.20120118221253.03aad598-Utvwg/EOxnhfq8cQ1yknNg@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: starlight-Utvwg/EOxnhfq8cQ1yknNg @ 2012-01-19  3:16 UTC (permalink / raw)
  To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

Also I don't think it is unfortunate (or a bug)
that vfork() continues to exist in Linux aside
from the fact that the semantics differ from
other *nixes in subtle and potentially
confusing ways.

As implemented in Linux vfork() is quite useful
and with the aforementioned clarifications to
the documentation, worth retaining.

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: suggestion for improvement to vfork() man page
@ 2012-02-07 21:50 starlight-Utvwg/EOxnhfq8cQ1yknNg
       [not found] ` <6.2.5.6.2.20120207164707.03c1f410-Utvwg/EOxnhfq8cQ1yknNg@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: starlight-Utvwg/EOxnhfq8cQ1yknNg @ 2012-02-07 21:50 UTC (permalink / raw)
  To: Mike Frysinger
  Cc: starlight-Utvwg/EOxnhfq8cQ1yknNg,
	linux-man-u79uwXL29TY76Z2rM5mHXA

+(However, on such systems,
+the preferred standard way of accomplishing the same result is to use
+.BR posix_spawn (3).)

I'm not sure I agree on this.  Linux posix_spawn()
calls fork() which for us is undesirable on MMU systems
due to the cost of copying large page tables.

To the extent that we would add support for non-MMU
platforms, we would stick with direct invocation of
vfork() even if the posix_spawn() on those targets
used vfork() instead of fork().  One less #ifdef,
of which we have far too many as it is.

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread
* suggestion for improvement to vfork() man page
@ 2012-01-19  3:04 starlight-Utvwg/EOxnhfq8cQ1yknNg
       [not found] ` <6.2.5.6.2.20120118214935.03aac8c8-8QzAbx0zao2B+jHODAdFcQ@public.gmane.org>
  0 siblings, 1 reply; 10+ messages in thread
From: starlight-Utvwg/EOxnhfq8cQ1yknNg @ 2012-01-19  3:04 UTC (permalink / raw)
  To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

Hello,

Please consider the following two suggestions for
adjusting the vfork() man page.

In the "Linux Description" section it should be
mentioned that vfork() does not suspend all the
threads in the parent process and only suspends
the thread issuing the call to vfork().  The
wording is misleading and I misunderstood the
semantics for a long time, thinking that all
threads would be suspended.  Had to test it to
determine the actual effect for certain.  In our
case suspending all threads for even a few
microseconds is unacceptable.

Also, it is important to note that the
clone(CLONE_VFORK|CLONE_VM) call invoked by
vfork() makes a separate copy of all process
resources except the address space.  While this is
implied by the statement "the vfork() function has
the same effect as fork(2)," this is easily
overlooked by someone who works with various UNIXs
where this is most definitely not the case.

This matters for situations like ours where a
process with a huge address space, real-time
priority and root privileges must occasionally
spawn scripts that should run at user priority
with user privileges.  Using fork() is expensive
due to the cost of replicating very large page
tables and vfork() is an excellent alternative.
But the subtle difference between Solaris/AIX and
Linux caused us to unnecessarily disable the code
that lowers priority and surrenders root
permission before issuing the exec() call to run
scripts.

Regards

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-02-08  1:13 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-19  3:16 suggestion for improvement to vfork() man page starlight-Utvwg/EOxnhfq8cQ1yknNg
     [not found] ` <6.2.5.6.2.20120118221253.03aad598-Utvwg/EOxnhfq8cQ1yknNg@public.gmane.org>
2012-01-19 18:36   ` Mike Frysinger
     [not found]     ` <201201191336.54114.vapier-aBrp7R+bbdUdnm+yROfE0A@public.gmane.org>
2012-02-07 21:38       ` Michael Kerrisk
  -- strict thread matches above, loose matches on Subject: below --
2012-02-07 21:50 starlight-Utvwg/EOxnhfq8cQ1yknNg
     [not found] ` <6.2.5.6.2.20120207164707.03c1f410-Utvwg/EOxnhfq8cQ1yknNg@public.gmane.org>
2012-02-07 23:04   ` Michael Kerrisk
2012-02-07 23:29   ` Eric Wong
     [not found]   ` <CAKgNAkjT05H1a9bk+d4XsEEsjUu0YEP10DDACCtBVsJ6OEsRYw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-08  1:13     ` starlight-Utvwg/EOxnhfq8cQ1yknNg
2012-01-19  3:04 starlight-Utvwg/EOxnhfq8cQ1yknNg
     [not found] ` <6.2.5.6.2.20120118214935.03aac8c8-8QzAbx0zao2B+jHODAdFcQ@public.gmane.org>
2012-02-07 21:06   ` Michael Kerrisk
     [not found]   ` <CAKgNAkgBfugTWMyaS4Nfvv802G=KB95_hx-cGuP6ckqAtSqyYA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-07 21:34     ` starlight-Utvwg/EOxnhfq8cQ1yknNg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).