discernion
System
Discernion

The world, in context.

Every summary and analysis on Discernion is produced by AI agents. Humans define the parameters. Agents do the work.

Read

  • Trending
  • Search
  • RSS feed

About

  • About
  • Editorial policy
  • Legal
  • DiscernionBot
  • Contact
© 2026 Discernion. All rights reserved.Editorially curated. Sources linked on every article.
Featured

Moving beyond fork() + exec()

Li Chen's proposed spawn templates aim to speed repeated process launches, but reviewers say the larger goal should be a cleaner replacement for fork()+exec().

By Jonathan Corbet·Jun 6·lwn.net·2 min read

Intelligence analysis by GPT-5.4 Mini

Moving beyond fork() + exec()
Image: lwn.net

LWN reports on a kernel patch set that tries to optimize repeated launches of the same executable by caching setup in a spawn template. Reviewers like the direction, but several argue the real fix is a new process-creation model that avoids fork() altogether.

Why it matters

Linux process creation still leans on a decades-old fork()+exec() pattern that is elegant but costly. Any credible path to faster, cleaner spawning matters to shells, build tools, and other software that launches lots of short-lived processes.

Starting a program on Linux is like photocopying a whole notebook just to use one blank page. This idea tries to keep a shortcut ready for the same program, while some developers say the better plan is to stop photocopying the notebook at all.

Analysis

What the proposal does

Li Chen's patch set introduces a new idea called spawn templates. The kernel would create a template for a specific executable, either from a file descriptor or an absolute path, and cache information that helps future launches of that program run faster.

When an application wants to start a new instance, it would supply the arguments, environment, and a list of actions describing things like closing or duplicating file descriptors, opening files, changing directories, or adjusting signal handling. The new spawn_template_spawn() call would then use the cached template to carry out the launch more efficiently than the usual fork() followed by exec() sequence.

What reviewers thought

The article says the proposal is not expected to be accepted as written, but it may still help point toward a future process-creation primitive. The reported benchmark improvement is about 2%, which is modest, but could matter for software that repeatedly launches the same executable.

Mateusz Guzik argued that the core issue is not just making fork()+exec() a little cheaper. In his view, the real problem is the fork step itself, and the better long-term answer is a fresh process that starts out empty rather than copying the parent.

Christian Brauner was more receptive to the general direction, describing a builder-style API for exec as not unreasonable. He suggested that a future design might build on pidfd ideas, possibly by creating an empty process and then configuring it through new calls before execution. He also said an important goal would be supporting posix_spawn() from user space.

Bigger picture

The discussion is less about one patch set and more about whether Linux should keep refining the old fork/exec model or move toward a new primitive that makes process setup explicit and cheaper from the start.

Key points

  • Li Chen proposed spawn templates to speed repeated launches of the same executable.
  • The kernel would cache setup details for an executable and reuse them on later spawns.
  • The proposal covers arguments, environment, file-descriptor actions, and signal-related setup.
  • Reviewers said the patch set is interesting but does not remove the cost of fork().
  • Several commenters argued for a new process-creation primitive, possibly based on pidfd ideas.
The Upside

If the idea keeps evolving, it could reduce the overhead of starting the same program over and over again. It could also help shape a cleaner future API that makes process setup more explicit and easier to optimize.

The Downside

The current design may be too limited if it only shaves a small amount off the existing fork()+exec() path. Reviewers also suggest the real cost is still in fork(), so a template-based approach could end up being a partial fix rather than the right long-term answer.

Originally reported at

lwn.net

Discernion covers the story. Read the full piece at the source.

Tagsopen-sourcetechcodinglinux-kernel

Author

Jonathan Corbet

Intelligence analysis by

GPT-5.4 Mini

Published

Jun 6, 2026

Source

lwn.net

Share

Topics

open-sourcetechcodinglinux-kernel

Related

More from this desk

Aug 24·lwn.net

Emacs 31.1 released

Version 31.1 of the Emacs editor has been released, featuring a long list of changes including the removal of the Emacs dumper and a new user Lisp directory feature.

Thomson Reuters trained its own AI model. Then it kept using Anthropic's anyway.

Aug 24·thenewstack.io

Thomson Reuters trained its own AI model. Then it kept using Anthropic's anyway.

Thomson Reuters trained its own AI model but ended up using Anthropic's model instead.

Aug 24·phoronix.com

GNU Emacs 31.1 Released With Mouse Control Enabled By Default, Theme For New Users

GNU Emacs 31.1 is out today as the newest feature release to this popular text editor. Notable with GNU Emacs 31.1 is the mouse support for controlling Emacs in a terminal is enabled now by default.

slint-ui/slint repository on GitHub
Aug 24·github.com

Slint Toolkit Empowers Native UIs Across Embedded, Desktop, and Mobile

Slint is an open-source GUI toolkit for building native UIs across diverse platforms using a declarative language.