Cost vs benefit ?
Cost vs benefit ?
Posted Jun 5, 2026 22:03 UTC (Fri) by alkbyby (subscriber, #61687)In reply to: Cost vs benefit ? by Cyberax
Parent article: Moving beyond fork() + exec()
Also I made mistake above. VMAs are not copied by vfork/CLONE_VFORK. So looks like only "unscalable" part of vfork is duplicating file descriptors. Of which most are being closed either explicitly or via O_CLOEXEC, in a most typical uses. Some processes have millions of those. But in most cases it is not expensive.
Again, I'd like to point out that people here (including myself) are speculating about costs. If costs are driving decision, then concrete numbers should be obtained.
I have a sense: a) fork has real issues b) people tend to (incorrectly) attribute much of it's issues to vfork c) the entire vfork+small set of signal-safe actions+exec is very very foot-gun heavy d) so it is tempting to kernel folk to propose something nicer
But IMHO as long as libc handles the foot-gun aspect by delivering high quality posix_spawn implementation, what is the difference?
