public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nptl/378] New: posix_spawn implementation, use vfork/execve rather than fork/execve for NPTL Linux.
@ 2004-09-10  0:48 dennis at mds dot rmit dot edu dot au
  2004-09-12  5:56 ` [Bug nptl/378] " drepper at redhat dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: dennis at mds dot rmit dot edu dot au @ 2004-09-10  0:48 UTC (permalink / raw)
  To: glibc-bugs

The pairing of fork/execve can still be extremely slow even
on modern Unix variants that use copy-on-write semantics.
If one manages to create a large process with an extremely
large number of memory mapped regions then fork/execve
performance degrades badly (many tens-of-times slower).
Copying the page table entries from parent to child can 
be an extremely expensive operation. That performance
penalty does not occur with vfork/execve.

The current generic glibc version of posix_spawn is based
around fork/execve. Hence, it will suffer from the performance
problem listed above.

Solaris 10 now comes with a posix_spawn implementation. Using
truss and speaking to Sun engineers it has been confirmed
that the new Solaris 10 posix_spawn uses vfork/execve.
Also the implementation they have carried out means their
new posix_spawn is thread safe (where their vfork is not).

When I raised this question at Red Hat bugzilla a friendly
Red Hat engineer responded with the following.

> It is impossible to use vfork in the linuxthreads libc, because 
> sigaction modifies global state, but most probably it should be 
> doable for NPTL libc, provided a few calls (e.g. *gid) are changed 
> into inline syscalls and adding code to run atfork registered 
> handlers before/after vfork in spawni.c.

So this enhancement request is for the glibc engineers to
investigate whether NPTL glibc posix_spawn can use vfork/execve
rather than fork/execve. If there are no obstacles then that
enhancement should be pushed through.

This will result in huge performance benefits for application
developers like us. The other benefit is that Solaris10 
and NPTL glibc posix_spawn would have the same performance
characteristics. Again that will be extremely.

Dennis.

-- 
           Summary: posix_spawn implementation, use vfork/execve rather than
                    fork/execve for NPTL Linux.
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: nptl
        AssignedTo: drepper at redhat dot com
        ReportedBy: dennis at mds dot rmit dot edu dot au
                CC: glibc-bugs at sources dot redhat dot com


http://sources.redhat.com/bugzilla/show_bug.cgi?id=378

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

end of thread, other threads:[~2014-06-13 10:43 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-378-131@http.sourceware.org/bugzilla/>
2014-06-13 10:43 ` [Bug nptl/378] posix_spawn implementation, use vfork/execve rather than fork/execve for NPTL Linux fweimer at redhat dot com
2004-09-10  0:48 [Bug nptl/378] New: " dennis at mds dot rmit dot edu dot au
2004-09-12  5:56 ` [Bug nptl/378] " drepper at redhat dot com
2004-09-12 18:06 ` drepper at redhat dot com
2004-09-12 22:54 ` roland at gnu dot org
2004-09-13  1:22 ` drepper at redhat dot com
2004-09-13  3:10 ` roland at gnu dot org
2004-09-13  4:18 ` dennis at mds dot rmit dot edu dot au
2004-09-13  6:35 ` jakub at redhat dot com
2004-09-13  7:46 ` roland at gnu dot org
2004-09-13  7:57 ` dennis at mds dot rmit dot edu dot au
2004-09-13  8:06 ` dennis at mds dot rmit dot edu dot au
2005-04-06 22:03 ` chris dot quenelle at sun dot com

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 read-only IMAP folder(s) and NNTP newsgroup(s).