Re: [Nmh-workers] vfork()

2011-12-25 Thread Robert Elz
Date:Sat, 24 Dec 2011 22:42:38 -0500
From:valdis.kletni...@vt.edu
Message-ID:  <150494.1324784...@turing-police.cc.vt.edu>

  | fork() should be almost as cheap as vfork() on any system that has a
  | sane memory manager that does copy on write of the memory.

On NetBSD, all the measurements (every time this comes up) show
vfork() outperforms fork() by a fairly large margin - but it matters
most for large processes, vfork() avoids the costs of establishing
a new process context, which is not cheap on many systems (even pc's).
It also avoids cache flushes needed when switching processes.

However I doubt that nmh is either big enough, or forks enough, for it
to make a difference anyone would be bothered by.

  | We don't do any vfork() without an immediately following exec*() call,
  | do we?

One would hope not, as that is what vfork() is intended for - to avoid the
cost of setting up a whole new process structure, only to tear it all down
again when the exec follows as (almost) the next syscall (usually just file
descriptor operations intervene).   Just borrowing the parent address space
is a fairly big win (even with copy on write, all the page descriptors still
need to be set up).

kre


___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


Re: [Nmh-workers] vfork()

2011-12-25 Thread David Levine
Lyndon wrote:

> We don't do any vfork() without an immediately following exec*()
> call, do we?

>From vmh.c:

#ifdef  hpux
switch (PEERpid = fork ()) {
/*
 * Calling vfork() and then another routine [like close()] before
 * an exec() messes up the stack frame, causing crib death.
 * Use fork() instead.
 */
#else   /* not hpux */
switch (PEERpid = vfork ()) {
#endif  /* not hpux */

I'll fork (:-) a separate thread on vmh and other unused files.

makedir.c calls setgid() and setuid() between vfork() and an exec*().

showfile.c calls strcmp().

mhbuildsbr.c calls close() and conditionally dup2() and fileno().

mhlsbr.c calls those plus snprintf() and sigaction() or signal().

With that, I won't look further.  I agree that vfork() should be
globally replaced with fork().

David

___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


Re: [Nmh-workers] vfork()

2011-12-24 Thread Valdis . Kletnieks
On Sat, 24 Dec 2011 18:01:44 PST, Lyndon Nerenberg said:

> Will replacing vfork() with fork() seriously impact nmh performance on
> any current UNIX variants?  (How many VAX users do we still have?)

fork() should be almost as cheap as vfork() on any system that has a
sane memory manager that does copy on write of the memory.

The linux manpage says there's a few slight differences between vfork()
and fork(), but nothing that should bother nmh.

We don't do any vfork() without an immediately following exec*() call, do we?


pgppXnjs8QbqU.pgp
Description: PGP signature
___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


Re: [Nmh-workers] vfork()

2011-12-24 Thread Jeffrey Honig
I gave up on VAXen when Paul Vixie gave up on the VAX port of BSD 4.4. (or
was it 4.3 Reno?).

http://www.unixguide.net/unix/programming/1.1.2.shtml

http://www.unix.com/man-page/POSIX/3posix/vfork/

Both indicate that a POSIX compliant system should not have problems with
that.

Thanks

Jeff

-- 
Jeffrey C. Honig 
http://www.honig.net/jch
GnuPG ID:14E29E13 



On Sat, Dec 24, 2011 at 21:01, Lyndon Nerenberg  wrote:

> Will replacing vfork() with fork() seriously impact nmh performance on any
> current UNIX variants?  (How many VAX users do we still have?)
>
> --lyndon
> -BEGIN PGP SIGNATURE-
>
> iQIcBAEBAgAGBQJO9oQMAAoJEG8PnXiV/JnUbf8P/0PN5l4HoXvCCyC3Xy0kTv+R
> puVua1crpZCzCbo+3GHENklDP7Uxe2v7+SfaXYZQX/YcTY5IBhwuIiCUyGOMCIaP
> YBcg1Aq1y/29OYh6/CSu3iJqWe0MdVX+vZKT1dSAiXDEOY0VnccIFCaTYEFZ/nBp
> iO7Oq4rnFpXmQiskk6LGU6dt84Vi+0bSDdaHM7R+KjSeyXJuBFl8zvH60tlXJgVE
> qNZdQFa0X6lvA9W0GQQpdLsyiasJGkuX9STnbZiKHWEYlGkCDb4M3rVKON7lKYeu
> MJDPQz0FRBXui0R/6F+vGTp6BpXbLqLjvF1SNpWXeLjdZqoFoYQXbnpgxcGlFf4e
> 6brqBOX6IMDcOeAcDHbWLyVaahuOdznwajl/l8m49DCM7Fdl5kezyIBg+xxZZtNd
> 2SPesuqdvpwL23+VBSMMqTZmmY2aJsi5M3HiV6uHxO8lnslfTFK4alqj3k2r4IRs
> DjpzeluBKCqihENXhZcc/ZQcEja3o1v43SynQMEjyb/RhgnnuGumn4QmNQoC3OBp
> tnmHq6RSEF7lM9oIE57cdeH+kytB8LouRXpH3HcOWr34DT1qxpQAXQ/T5U1TJNYa
> RlGZHBMCyzwDkwRG99ekef17nriPaTkoVAuBNsyvwTzOjUlxQtU5b2OjloV2m/3w
> kphOuFmsrs/DlIKBTu51
> =Nih3
> -END PGP SIGNATURE-
>
> ___
> Nmh-workers mailing list
> Nmh-workers@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/nmh-workers
>
>
___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


[Nmh-workers] vfork()

2011-12-24 Thread Lyndon Nerenberg
Will replacing vfork() with fork() seriously impact nmh performance on any 
current UNIX variants?  (How many VAX users do we still have?)

--lyndon

signature.asc
Description: Message signed with OpenPGP using GPGMail
___
Nmh-workers mailing list
Nmh-workers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/nmh-workers