linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFD] Combined fork-exec syscall.
@ 2003-04-28  0:57 Mark Grosberg
  2003-04-28  0:59 ` Larry McVoy
                   ` (6 more replies)
  0 siblings, 7 replies; 48+ messages in thread
From: Mark Grosberg @ 2003-04-28  0:57 UTC (permalink / raw)
  To: linux-kernel


Hello all,

Is there any interest in a single system call that will perform both a
fork() and exec()? Could this save some extra work of doing a
copy_mm(), copy_signals(), etc?

I would think on large, multi-user systems that are spawning processes all
day, this might improve performance if the shells on such a system were
patched.

Perhaps a system call like:

   pid_t spawn(const char *p_path,
               const char *argv[],
               const char *envp[],
               const int   filp[]);

The filp array would allow file descriptors to be redirected. It could be
terminated by a -1 and reference the file descriptors of the current
process (this could also potentially save some dup() syscalls).

If any of these parameters (exclusing p_path) are NULL, then the
appropriate values are taken from the current process.

I originally was thinking of a name of fexec() for such a syscall, but
since there are already "f" variant syscalls (fchmod, fstat, ...) that an
fexec() would make more sense about executing an already open file, so the
name spawn() came to mind.

I know almost all of my fork()-exec() code does almost the same thing. I
guess vfork() was a potential solution, but this somehow seems cleaner
(and still may be more efficient than having to issue two syscalls)...
the downside is, of course, another syscall.

L8r,
Mark G.


^ permalink raw reply	[flat|nested] 48+ messages in thread
* Re: [RFD] Combined fork-exec syscall.
@ 2003-04-28  3:03 Davide Libenzi
  0 siblings, 0 replies; 48+ messages in thread
From: Davide Libenzi @ 2003-04-28  3:03 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Linux Kernel Mailing List


On Sun, 27 Apr 2003, Ulrich Drepper wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Davide Libenzi wrote:
>
> > This is very much library stuff. I don't think that saving a couple of
> > system calls will give you an edge, expecially when we're talking of
> > spawning another process. Even if the process itself does nothing but
> > return. Ulrich might be eventually interested ...
>
> POSIX has a spawn interface, see <spawn.h> on modern systems.
                                                ^^^^^^^^^^^^^^
( You want to make me pay for the last question about swapcontext in our
old glibc environment, don't you ? ;)

If I read the specification correctly, the posix_spwan() interface will
not solve scalability problems due to huge file tables. If I read it
correctly, and if you have M files currently opened and you want to
keep/dup only three files, you have to drop (M-3) close actions plus 3 dup
actions. To solve such problem you'd need a default-all-closed option plus
3 dup actions. That inside the kernel will translate in a brand new file
table plus 3 links.




- Davide


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

end of thread, other threads:[~2003-05-06  2:36 UTC | newest]

Thread overview: 48+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-28  0:57 [RFD] Combined fork-exec syscall Mark Grosberg
2003-04-28  0:59 ` Larry McVoy
2003-04-28  1:16   ` Mark Grosberg
2003-04-28  1:36     ` Måns Rullgård
2003-04-28  1:45       ` Mark Grosberg
2003-04-28  1:49       ` dean gaudet
2003-04-28  1:59         ` Mark Grosberg
2003-04-28  2:27           ` Miles Bader
2003-04-28 19:07           ` dean gaudet
2003-05-01 13:14       ` Jakob Oestergaard
2003-04-28  1:17 ` Davide Libenzi
2003-04-28  1:28   ` Mark Grosberg
2003-04-29  2:01     ` Rafael Costa dos Santos
2003-04-28  1:41   ` Ulrich Drepper
2003-04-28  1:49     ` Mark Grosberg
2003-04-28  2:19       ` Ulrich Drepper
2003-04-28  6:59       ` Kai Henningsen
2003-04-28  1:35 ` dean gaudet
2003-04-28  1:43   ` Mark Grosberg
2003-04-28  3:44     ` Mark Mielke
2003-04-28  5:16       ` Jamie Lokier
2003-04-28  2:38   ` Davide Libenzi
2003-04-28  2:09 ` Richard B. Johnson
2003-04-28  2:12   ` Mark Grosberg
2003-04-28  2:42     ` Werner Almesberger
2003-04-28  6:35       ` Mark Grosberg
2003-04-29  2:47       ` Rafael Santos
2003-04-28  3:20         ` Werner Almesberger
2003-04-28 13:00     ` Richard B. Johnson
2003-04-28 13:22       ` Andreas Schwab
2003-04-28 13:57         ` Richard B. Johnson
2003-04-28 13:57           ` Andreas Schwab
2003-04-28 14:16             ` Richard B. Johnson
2003-04-28 14:38               ` Valdis.Kletnieks
2003-04-28 14:56                 ` Richard B. Johnson
2003-04-28 14:42               ` Andreas Schwab
2003-04-28 16:36       ` Mark Grosberg
2003-04-28 17:19         ` Davide Libenzi
2003-04-28 18:28         ` Craig Ruff
2003-05-06  2:48         ` Miles Bader
2003-04-29 18:50       ` Timothy Miller
2003-04-28  2:32   ` Werner Almesberger
2003-04-28  7:40 ` Mirar
2003-04-28 12:45 ` Matthias Andree
2003-04-29  1:05 ` Rafael Costa dos Santos
2003-04-28  1:19   ` Mark Grosberg
2003-04-29  1:29     ` Rafael Costa dos Santos
2003-04-28  3:03 Davide Libenzi

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).